Re: Multiple Applications writing to same log file

2018-08-10 Thread Jochen Wiedmann
On Fri, Aug 10, 2018 at 12:29 PM Rajvinder Pal wrote: > Can multiple web applications write to same log file using log4j2 ? Should > i create separate log file for each web application? The easiest solution would be to add the log4j jars to a shared ClassLoader. (Thus, doing exactly that, what I

Re: Log4j2 in web Application

2018-08-10 Thread Jochen Wiedmann
Hi, On Fri, Aug 10, 2018 at 10:48 AM Rajvinder Pal wrote: > > Hi, > > I have a query regarding log4j2 initialization from external location. Why > cannot i initialize log4j2 by specifying System Property in Application > server as > > log4j.configurationFile : file:///d:/log4j2.xml > > and get L

Re: Category is missing

2017-08-14 Thread Jochen Wiedmann
ogging configuration as all > those logs are generated before and during configuration. > > Ralph > >> On Aug 14, 2017, at 8:33 AM, Jochen Wiedmann >> wrote: >> >> Hi, >> >> my log4j2.xml specifies a pattern (%d{HH:mm:ss.SSS} %-5level [%t] %c - >> %

Category is missing

2017-08-14 Thread Jochen Wiedmann
Hi, my log4j2.xml specifies a pattern (%d{HH:mm:ss.SSS} %-5level [%t] %c - %msg%n), which ought to include the category. However, my log file looks like below. Am I missing something obvious here? Thanks, Jochen 2017-08-14 16:38:09,700 localhost-startStop-1 DEBUG PluginManager 'Core' found 112

Re: log4j2 - Logger does not have the configuration If procured before LoggerContext has initialized

2016-11-30 Thread Jochen Wiedmann
On Wed, Nov 30, 2016 at 9:41 AM, Mikael Ståldal wrote: > Any particular reason for not using a configuration file? Do you have reason to believe, that this would change the behaviour? -- The next time you hear: "Don't reinvent the wheel!" http://www.keystonedevelopment.co.uk/wp-content/uploa

Re: Switching log levels at runtime with log4j2

2016-11-29 Thread Jochen Wiedmann
On Mon, Nov 28, 2016 at 9:58 PM, Gary Gregory wrote: > Does this help: > https://garygregory.wordpress.com/2016/01/11/changing-log-levels-in-log4j2/ Hi, Gary, considering what's all in Configurator nowadays, I wonder, whether one could also add a small compatibility layer for log4j, say BasicCon

Re: Different Processes, same Logfile

2016-06-26 Thread Jochen Wiedmann
On Sat, Jun 25, 2016 at 4:39 PM, Remko Popma wrote: > If you configure a FileAppender > > with the locking option set to true, Log4j will do the rest. Thanks very much, Remko. Exactly, what I was hoping for. Jochen --

Re: Different Processes, same Logfile

2016-06-25 Thread Jochen Wiedmann
On Sat, Jun 25, 2016 at 9:01 AM, Ralph Goers wrote: > In order for multiple processes to share a log file os file locking has to be > used, which impacts performance considerably. Furthermore, only a regular > FileAppender can be used. You really can’t share a rolling file safely as > both proc

Different Processes, same Logfile

2016-06-24 Thread Jochen Wiedmann
Hi, is it possible. that multiple proceses share a common log file. (The processes aree command line executables, ,which will be started at unpredictable times. Thanks, Jochen -- The next time you hear: "Don't reinvent the wheel!" http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/

Re: Multiple instances of log4j2.xml

2016-06-17 Thread Jochen Wiedmann
On Fri, Jun 17, 2016 at 3:07 PM, Ralph Goers wrote: > You would use Configurator.initialize(“MyContextName”, > this.getClass().getClassLoader(), uri); > > The classLoader value can be null. Thanks, Ralph. One question, though: The class Configurator is not present on http://logging.apache.or

Multiple instances of log4j2.xml

2016-06-17 Thread Jochen Wiedmann
Hi, I have an application (more precisely: a war file), which is deployed identically on the same application server. (Think multi temancy), Now, in Log4j 1, I handled that situation quite easily, like this: final String uri = tenantName + "/log4j.xml"; final URL url = ClassLoader.getReso

Re: Programmatic configuration => NPE

2016-06-10 Thread Jochen Wiedmann
On Fri, Jun 10, 2016 at 2:38 PM, Douglas Wegscheid wrote: > what does MyConfigurationFactory look like? Throws an IllegalStateException in all methods. Just to demonstrate, that it is invoked. (Or isn't.) Jochen -- The next time you hear: "Don't reinvent the wheel!" http://www.keystonedeve

Re: Programmatic configuration => NPE

2016-06-10 Thread Jochen Wiedmann
On Thu, Jun 9, 2016 at 2:45 PM, Remko Popma wrote: > Do you have a stacktrace? Silly me. Of course, I have: Exception in thread "main" java.lang.NullPointerException: No Configuration was provided at java.util.Objects.requireNonNull(Objects.java:228) at org.apache.logging.log4j.core.LoggerConte

Programmatic configuration => NPE

2016-06-09 Thread Jochen Wiedmann
Hi, what is wrong with the following code, please (gives an NPE within getLogger, MyConfigurationFactory is never being invoked). public static void main(String[] pArgs) { ConfigurationFactory.setConfigurationFactory(new MyConfigurationFactory()); final Logger log = LogManager

Dynamically creating loggers

2016-04-15 Thread Jochen Wiedmann
Hi, I've got an application, where I would like to obtain loggers on the fly, because the logger name isn't known in advance. (Think of it as a logging server, which will be used by remote clients.) Now, creating a Logger might be an expensive operation. Thus, my question: - Would you recommend

Re: LoggerContext is reloaded on application shutdown

2015-10-20 Thread Jochen Wiedmann
This is quite as it should. If the webapp is being shutdown, then all acquired resources (including the logging system) are to be released. You'd end up with a resource leak otherwise. Why do you expect log4j to be an exception? Jochen On Tue, Oct 20, 2015 at 6:41 PM, Benoit Mouquet wrote: > He

Re: Log4J2 NoSQL query

2015-07-22 Thread Jochen Wiedmann
On Wed, Jul 22, 2015 at 8:01 AM, kusmanjali wrote: > 1. Most of the logging frame works use a log forwarder + queue > mechanism(Logstash, Fluectd) to store logs into database. What is the > advantage of using this over using Log4j NoSQL appenders to write directly > to the database. > Our idea is

Re: Hide *.jar

2015-06-30 Thread Jochen Wiedmann
My understanding is that generating this information doesn't add to the performance penalty of creating a stack trace, so I don't think its worth bothering. On Tue, Jun 30, 2015 at 1:09 AM, Gary Gregory wrote: > Worth a FAQ or manual entry? > > Gary > > On Mon, Jun 29, 2015 at 9:33 AM, Ralph Goe

Re: log4j2 for java 1.6.x?

2015-05-26 Thread Jochen Wiedmann
Wouldn't this be an excellent use case for migration to Git, so that a 1.6 specific branch can be maintained with minor efforts for some time? Jochen On Tue, May 26, 2015 at 6:00 PM, Ralph Goers wrote: > To be clear, the plan is to do future enhancements against Java 1.7, but if > there is a b

What happened to chainsaw?

2005-10-07 Thread Jochen Wiedmann
Hi, following the instructions on http://logging.apache.org/log4j/docs/chainsaw.html I downloaded install-chainsaw.xml, which seems to do its job. However, the downloaded build.xml neither contains a "chainsaw" target nor does the "chainsaw" directory contain any relevant files. Thanks, Jo

Chainsaws file format

2005-09-10 Thread Jochen Wiedmann
Hi, sorry if I am missing something obvious, but my impression is, that chainsaw can parse only files in the pseudo xml format. I would need to parse files generated using the pattern layout. Is it possible to achieve that? Regards, Jochen -- Having experienced 7 years of labour/green governme