Re: Intermittent log file compression issue

2015-03-24 Thread Remko Popma
Richard, So, if you specify the config location with system property log4j.configurationFile then old log files are compressed correctly on rollover, correct? If you include the config file in your application jar and rely on the classpath then what happens? Is rollover the only thing that

Re: Intermittent log file compression issue

2015-03-25 Thread Remko Popma
archived. Regards, Richard. On 25 Mar 2015 09:20, Richard Kolb rjdk...@gmail.com wrote: Hi Remko On 25 March 2015 at 04:21, Remko Popma remko.po...@gmail.com wrote: So, if you specify the config location with system property log4j.configurationFile then old log files

Re: Migrating from log4j 1x to 2x

2015-03-04 Thread Remko Popma
The log4j2 manual contains many xml fragments. In general log4j2 is much better documented than log4j1. Sent from my iPhone On 2015/03/05, at 7:11, Mangat Rai mangat.go...@hotmail.com wrote: Dan, Thank you very much for reply. I kind of got hold of xml file. now i am playing around with

Re: Memory leak by not disposing loggers

2015-04-19 Thread Remko Popma
No, I think the old LoggerConfig objects can be GC-ed after a reconfiguration. Sent from my iPhone On 2015/04/20, at 8:07, Gary Gregory garydgreg...@gmail.com wrote: Are loggers GC'd on a reconfigure? Gary Original message From: Remko Popma remko.po...@gmail.com

Re: Memory leak by not disposing loggers

2015-04-19 Thread Remko Popma
Loggers are not GC-ed until the whole logging subsystem is GC-ed. That is until your webapp is unloaded or standalone process is stopped. Is your app a webapp? Sent from my iPhone On 2015/04/20, at 1:27, Gary Gregory garydgreg...@gmail.com wrote: The LoggerContext.loggers is a

Re: XMLLayout dependencies

2015-05-11 Thread Remko Popma
I suspect you need Jackson. Dependencies are documented here: http://logging.apache.org/log4j/2.x/log4j-core/index.html Sent from my iPhone On 2015/05/11, at 17:24, Mikael Ståldal mikael.stal...@magine.com wrote: Which library dependencies do I need to use the XMLLayout? Is this

Re: flushing async loggers

2015-06-21 Thread Remko Popma
Async loggers will call flush() when the queue is empty. If you are not seeing all expected output in the file I suspect that async loggers are not actually enabled. You can verify with jstack or break your program in a debugger. There should be an AsyncLogger... thread. How do you ensure

Re: flushing async loggers

2015-06-22 Thread Remko Popma
, Logging system initialization); } And now everything works :) Your thoughts? But cool, everything works now - but I'm still interested in any input you might have (because it is a bit of a hack, with zero understanding of what's happening on my part) On Mon, Jun 22, 2015 at 1:30 AM, Remko

Re: how to reinitialize log4j2 configuration?

2015-06-17 Thread Remko Popma
I added this (and two more questions) to the FAQ. Please verify if I got the LogManager.getContext(TRUE/FALSE) parameter right... On Wed, Jun 17, 2015 at 7:49 AM, Gary Gregory garydgreg...@gmail.com wrote: Is this an item for our FAQ or manual? It would be nice to eventually be able to answer

Re: Log4j - Jul Bridge in a web application

2015-07-03 Thread Remko Popma
That logger (used in logger.info(JSR 356 Mapping path {}, servletPath);), can you check where/how it is created? The error indicates you are using a https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/message/MessageFormatMessageFactory.html while the {} for

Re: Log4j - Jul Bridge in a web application

2015-07-04 Thread Remko Popma
/log4j-jul/apidocs/org/apache/logging/log4j/jul/CoreLoggerAdapter.html ) calls in B context.getLogger(name, MESSAGE_FACTORY) where MESSAGE_FACTORY = new MessageFormatMessageFactory(), On Fri, 3 Jul 2015 at 21:41 Remko Popma remko.po...@gmail.com wrote: That logger (used in logger.info(JSR

Re: java.lang.NoSuchFieldError: errorHandler

2015-08-14 Thread Remko Popma
Bart, In reality we haven't been fixing issues in log4j 1.2 for a while, so the announcement doesn't really change anything. We are all volunteers working on this in our spare time, and we choose to spend our time working on log4j 2. We thought it was better for everyone if we make our intentions

Re: FATAL Unable to register shutdown hook because JVM is shutting down.

2015-07-20 Thread Remko Popma
Gary, enjoy your holiday! Mikael, At first glance it seems to me that this problem happens because the application does not start logging until it has done all the work and the JVM is shutting down. However, I'm not sure it really is a problem: Log4j tried to registered a shutdown hook, but

Re: ERROR Unable to rename file in version 2.4 and 2.4.1

2015-10-23 Thread Remko Popma
Would you mind raising a Jira ticket for this issue? Thanks in advance! On Fri, Oct 23, 2015 at 4:32 AM, Hai-Dang Pham wrote: > I have confirmed it works with version 2.3. So failure started happening in > 2.4 when using java.nio.file.Files. > > > Hi, > > > > When using

Re: how to detect logger is unable to write to file?

2015-10-29 Thread Remko Popma
similar issue with log4j2, is there any log that >>> contains the error that log4j was not able to write to file? >>> >>>> On Thu, Oct 29, 2015 at 3:53 PM, Remko Popma <remko.po...@gmail.com> wrote: >>>> What action should the daemon take when its q

Re: how to detect logger is unable to write to file?

2015-10-29 Thread Remko Popma
With Async Loggers you can set an ExceptionHandler. Is that what you mean? Sent from my iPhone > On 2015/10/30, at 9:07, Nicholas Duane wrote: > > I could have sworn I saw some way to provide a sink for log4j2 (or maybe it > was log4net) internal events. I just did a quick

Re: Log4j2 - HTML emails pattern

2015-11-09 Thread Remko Popma
Ben, The built-in HTML layout (https://logging.apache.org/log4j/2.x/log4j-core/xref/org/apache/logging/log4j/core/layout/HtmlLayout.html) does not support much customization. It sounds like you may want to create a custom layout and specify that layout with the SMTP appender. This manual

Re: Log entries written to wrong file

2015-11-11 Thread Remko Popma
o initialize Log4j 2 in a web application > >><http://logging.apache.org/log4j/2.x/manual/webapp.html> and set the > >>system property or servlet context parameter Log4jContextSelector to > >>org.apache.logging.log4j.core.selector.JndiContextSelector.

Re: RollingFileAppender maxDelayMillis?

2015-11-10 Thread Remko Popma
To check my understanding: the problem is that with bufferedIO=true the buffer contains log events that you want to see, but the buffer is only flushed to disk when it is full (which is not frequent enough); is that correct? If you use AsyncAppender or Async Loggers, the buffer will be flushed

Re: RollingFileAppender maxDelayMillis?

2015-11-10 Thread Remko Popma
On Wed, Nov 11, 2015 at 2:34 PM, Benjamin Jaton <benjamin.ja...@gmail.com> wrote: > On Tue, Nov 10, 2015 at 6:13 PM, Remko Popma <remko.po...@gmail.com> > wrote: > > > To check my understanding: the problem is that with bufferedIO=true the > > buffer contain

Re: Log entries written to wrong file

2015-11-05 Thread Remko Popma
Two quick questions: What is your log4j2 version, and are you using Async Loggers? On Fri, Nov 6, 2015 at 2:17 AM, Chinh Do wrote: > Hi all, > > I am running multiple web apps (WARs) in the same WebSphere instance. Each > web app has its own log4j2.xml and is configured to

Re: Difference between and -DAsyncLoggerContextSelector

2015-10-19 Thread Remko Popma
Agreed: if you use -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector then *all* loggers will be async. If you do not use the -DLog4jContextSelector=... system property then only loggers configured with or will be async and the loggers configured as will be

Re: Bizarre performance in log4j2

2015-10-11 Thread Remko Popma
See also http://logging.apache.org/log4j/2.x/manual/async.html#Location and http://logging.apache.org/log4j/2.x/manual/async.html#Throughput_of_Logging_With_Location_includeLocationtrue On Sun, Oct 11, 2015 at 1:54 PM, Remko Popma <remko.po...@gmail.com> wrote: > The problem with th

Re: Bizarre performance in log4j2

2015-10-12 Thread Remko Popma
t; >> On Sun, Oct 11, 2015 at 7:56 PM, Remko Popma <remko.po...@gmail.com> wrote: >> >> See also http://logging.apache.org/log4j/2.x/manual/async.html#Location >> and >> >> http://logging.apache.org/log4j/2.x/manual/async.html#Throughput_of_Loggin

Re: Bizarre performance in log4j2

2015-10-12 Thread Remko Popma
Output looks ok. Sleep was the default wait strategy but has been changed to Block a long time ago. Looks like the docs are out of date. Thanks for drawing my attention to this. I don't understand why changing the includeLocation does not make a difference in performance. You should see a large

Re: Bizarre performance in log4j2

2015-10-13 Thread Remko Popma
; ...and make sure that no 3rd party dependencies brings them in. > > > > On Tue, Oct 13, 2015 at 8:22 AM, Remko Popma <remko.po...@gmail.com> > > wrote: > > > > > Please remove log4j-1.2.16 and replace it with log4j-1.2-api version > 2.3. > > > &

Re: Bizarre performance in log4j2

2015-10-10 Thread Remko Popma
How did you measure the good performance (with sync logging) and the bad performance (with async)? What happens exactly when "it turns terrible"? On Saturday, 10 October 2015, Strong Su wrote: > Hello everyone, > I'm still testing log4j2 on our projects. > When using it, I

Re: How to make all loggers async when run war file?

2015-10-09 Thread Remko Popma
Hi Dylan, I did a quick google search on "system properties tomcat". >From https://tomcat.apache.org/tomcat-6.0-doc/config/index.html All system properties are available including those set using the -D syntax, those automatically made available by the JVM and those configured in the

Re: Bizarre performance in log4j2

2015-10-13 Thread Remko Popma
>log4j-core >2.3 > > >org.apache.logging.log4j >log4j-web > 2.3 > > >com.lmax >disruptor >3.2.0 > > > >> On Tue, Oct 13, 2015 at 12:22 PM, Remko Popma <remko.po...@gmail.com> wrote: >> >> For log4j1, are yo

Re: Bizarre performance in log4j2

2015-10-12 Thread Remko Popma
ct 12, 2015 at 6:56 PM, Strong Su <lovelo...@gmail.com> wrote: >> >> I'm using Log4j 2.3 and Disruptor 3.2. >> Because of third party package like spring, I have to use Log4j 1.2 and >> slf4j 1.5 too. >> >> >> On Tue, Oct 13, 2015 at 7:15 AM, Re

Re: range filter?

2015-08-25 Thread Remko Popma
appenderRef ref=“appender2” Filters ThresholdFilter level=“FATAL” onMatch=“DENY” onMisMatch=“NEUTRAL”/ ThresholdFilter level=“INFO” onMatch=“ACCEPT” onMisMatch=“DENY”/ /Filters /appenderRef /root On Aug 25, 2015, at 8:06 PM, Remko Popma remko.po...@gmail.com wrote

Re: redefining existing levels?

2015-08-25 Thread Remko Popma
How are users currently able to set the log level to OFF? Do they modify the config? Sent from my iPhone On 2015/08/26, at 11:35, Nicholas Duane nic...@msn.com wrote: It just dawned on me that my solution of redefining OFF to the INFO level only addresses the case of someone setting the

Re: range filter?

2015-08-25 Thread Remko Popma
The StackOverflow link was an answer to the question how to send _only_ INFO level events to an appender. I thought it would illustrate how filters combinations could be used to achieve the original request: I might want all DEBUG, TRACE and VERBOSE events going to one appender. All INFO,

Re: plugins

2015-08-27 Thread Remko Popma
Perhaps the simplest thing to do is to add the packages attribute to your log4j2.xml configuration file. Set the value to the package of your custom plugin. Configuration status=trace packages=com.mycomp.pluginpackage ... Remko Sent from my iPhone On 2015/08/28, at 6:42, Nicholas Duane

Re: plugins

2015-08-27 Thread Remko Popma
I think you made a mistake there: your config says Configuration status=trace verbose=true packages=LevelRangeFilter But your code does not have a package declaration at the top. This means it is in the default (nameless) package. Change your code to start with: package

Re: redefining existing levels?

2015-08-26 Thread Remko Popma
I am glad I asked these questions. In my opinion, you cannot protect people from messing up your configuration by providing them with some configuration, for the simple reason that they can modify your changes. I am also with Ralph in that I am not a fan of a minimum log level that would ignore

Re: custom levels via configuration

2015-08-26 Thread Remko Popma
Nick, What was the output of this program? Were both INFOM1 and INFOP1 not found, or was INFOM1 found (because it is used in the ThresholdFilter), but not INFOP1? Remko On Thu, Aug 27, 2015 at 3:19 AM, Nicholas Duane nic...@msn.com wrote: On to my next problem. I'm trying to define a

Re: custom levels via configuration

2015-08-26 Thread Remko Popma
I don't have time to investigate now, but it looks like our support for CustomLevels is not implemented in ThresholdFilter yet. If you use a custom level in your logger config it should work. For example: loggers root level=INFOP1 appenderref ref=file level=INFOM1 / ... Remko On Thu,

Re: approach for defining loggers

2015-08-31 Thread Remko Popma
Not sure that I understand your use case, so let me give a concrete example of how I use loggers. At work I have a component that is responsible for handling marketdata. This component has two loggers: one that uses the component class name as its name, another called "RAW_FEED". The first

Re: FileAppender append="false" does not truncate the file on startup

2015-09-01 Thread Remko Popma
Can you provide your full configuration? (You may want to raise a Jira ticket to track this issue.) To confirm, the actual behaviour is that log4j appends to the end of the existing app.log file, is that correct? Sent from my iPhone > On 2015/09/02, at 2:50, Sharath Gururaj

Re: Question about RollingFileAppender

2015-09-02 Thread Remko Popma
Jerry, As of now, log4j 2 does not support auto-delete on rollover. However, this is a commonly requested feature and is on the todo list. We just haven't gotten around to working on it yet. The relevant Jira ticket is https://issues.apache.org/jira/browse/LOG4J2-435 Remko Sent from my

Re: range filter?

2015-08-25 Thread Remko Popma
You misread the comment. The commentor basically told me the answer works with a minor change, and that he would mark the question as done if I would edit my answer (which I did). So the answer works and seems to apply to your use case, no? The question is if it also works with custom

Re: range filter?

2015-08-25 Thread Remko Popma
Can you try something similar to this http://stackoverflow.com/questions/24695133/log4j2-filter-particular-level-in-apender/24697002#24697002 and see if that works with custom levels as well? On Wed, Aug 26, 2015 at 6:04 AM, Nicholas Duane nic...@msn.com wrote: I've tried a couple different

Re: redefining existing levels?

2015-08-25 Thread Remko Popma
Is redefining levels a way to work around the issue you had with the range check? I've replied to your range check question with a link to an example config. On Wed, Aug 26, 2015 at 8:02 AM, Gary Gregory garydgreg...@gmail.com wrote: Well, let's all work together to get you up and running.

Re: Question - RollingFileAppender creates empty files

2015-09-16 Thread Remko Popma
Hi, Can you provide your configuration file? Remko On Wed, Sep 16, 2015 at 11:23 PM, Csilla Fabian wrote: > Hello, > > I'm using log4j2 RollingFileAppenders to log events of a complex system. > My problem is that empty log files are created for every appender even if >

Re: Log4j 2.4 compressed archived log corrupted?

2015-09-26 Thread Remko Popma
Thanks for reporting this! It looks like we introduced a bug where the app.log file is renamed to app.log.gz (just renamed, not compressed), so the compress action cannot find the file to compress... I raised the following Jira to track the issue: https://issues.apache.org/jira/browse/LOG4J2-1135

Re: Logging complete exception trace.

2015-09-18 Thread Remko Popma
log.error("Got the exception", ex); >} > > I was under impression that this should log the complete trace, but its not. > > Any ideas as what I am missing ? > > > > >> On Fri, Sep 18, 2015 at 1:49 PM, Remko Popma

Re: Logging complete exception trace.

2015-09-18 Thread Remko Popma
23).http-bio-8084-exec-35Ex > > > All my classes are giving single line exception message, > > How do I debug this issue now ? > > > > > >> On Fri, Sep 18, 2015 at 2:57 PM, Remko Popma <remko.po...@gmail.com> wrote: >> >> Hmm, you

Re: Logging complete exception trace.

2015-09-18 Thread Remko Popma
In your application, do not use logger.error(exception); but use logger.error("some message", exception); instead. The first form will take the exception object as an object and calls toString() on it, which is not what you want. Remko Sent from my iPhone > On 2015/09/18, at 18:00, Kiran

Re: Help about log4j tests

2015-09-24 Thread Remko Popma
> Thank you. > > Best Regards, > Dylan > > On Tue, Sep 22, 2015 at 12:18 PM, Remko Popma <remko.po...@gmail.com> > wrote: > > > Dylan, > > > > I agree the JMH microbenchmark tool gives different results than I > expected > > fo

Re: Migrating from log4j to log4j2

2015-12-02 Thread Remko Popma
If I understand correctly, your users can modify the log configuration via a web interface? You can use the log4j 2 JMX MBeans to get the internal log4j status messages and display those to the users. Sent from my iPhone > On 2015/12/03, at 2:12, Chathura Widanage

Re: Recursive call to appender stackoverflow error

2015-12-11 Thread Remko Popma
Did this resolve the problem? On Friday, 11 December 2015, Remko Popma <remko.po...@gmail.com> wrote: > You may have both the log4j-to-slf4j adapter jar and the log4j-slf4j-impl > jar on the classpath. They will route calls to each other. You need to > remove one of them. > >

Re: Bizarre performance in log4j2

2015-12-13 Thread Remko Popma
.@gmail.com> wrote: >>> >>> Hello everyone, >>> >>> It takes me sometime to make sure that I have removed all log4j-1.2.16 >>> and slf4j-log4j12. >>> It became better but not good enough. >>> Since sync log4j2 has already performe

Re: Recursive call to appender stackoverflow error

2015-12-10 Thread Remko Popma
You may have both the log4j-to-slf4j adapter jar and the log4j-slf4j-impl jar on the classpath. They will route calls to each other. You need to remove one of them. Sent from my iPhone > On 2015/12/11, at 10:55, Priya Ahuja wrote: > > Hi, > > Any idea why I am seeing

Re: Aw: Placeholder substitution in config xml

2016-01-04 Thread Remko Popma
Looks like the properties lookup does not account fully for default values that are themselves lookups. Can you create a Jira ticket for this? Thanks! Remko Sent from my iPhone > On 2016/01/04, at 23:56, Veit Guna wrote: > > Small correction: the system property is set via

Re: Trigger RollingRandomAccessFile appender programmtically?

2016-01-02 Thread Remko Popma
You can try specifying the package of your custom plugin in the attribute of your configuration. Sent from my iPhone > On 2016/01/03, at 8:22, John Lussmyer wrote: > > On Mon Dec 21 15:16:14 PST 2015 cou...@casadelgato.com said: >> On Mon Dec 21 14:11:31 PST 2015

Re: Using log4j1.2.17 foter is not getting added to each log file in rollingfileappender

2016-01-05 Thread Remko Popma
FWIW, decoupling the filePattern from the rollover frequency is one of the things I had in mind with 1. LOG4J2-1198 . On Tuesday, 5 January 2016, Gary Gregory wrote: > On Mon, Jan 4, 2016 at 11:04 PM, Anshu Garg1

Re: Using log4j1.2.17 foter is not getting added to each log file in rollingfileappender

2016-01-06 Thread Remko Popma
Anshu Garg > Platform Technology Center, India > > Phone: 8800096760 > E-mail: anshug...@in.ibm.com > > > > From: Remko Popma <remko.po...@gmail.com> > To: Log4J Users List <log4j-user@logging.apache.org> > Date: 01/06/2016 04:22 AM >

Re: Using log4j1.2.17 foter is not getting added to each log file in rollingfileappender

2016-01-07 Thread Remko Popma
and also footer at end of > each file out of the box. > > -Thanks & Regards, > Anshu Garg > Platform Technology Center, India > > Phone: 8800096760 > E-mail: anshug...@in.ibm.com > > > > From: Remko Popma <remko.po...@gmail.com> > To:

Re: Using log4j1.2.17 foter is not getting added to each log file in rollingfileappender

2016-01-05 Thread Remko Popma
Thanks for raising these issues. In addition to Gary's response, can I ask some more questions to clarify? 1. Does LOG4J2-1101 capture your first requirement for a date in the pre-rollover file name? 3. I believe you are already verifying the

Re: Log4j2 json configuration doesn't write to files.

2015-11-27 Thread Remko Popma
Instead of doing Logger logger = LoggerFactory.getLogger(User.class); logger.info("info", id); Can you try: // to target the "text-roll" appender, use the logger named "info" Logger logger = LoggerFactory.getLogger("info"); logger.debug("any message should work"); Also, you have

Re: Programmatic configuration => NPE

2016-06-09 Thread Remko Popma
Do you have a stacktrace? Sent from my iPhone > On 2016/06/09, at 20:09, Jochen Wiedmann wrote: > > Hi, > > what is wrong with the following code, please (gives an NPE within > getLogger, MyConfigurationFactory is never being invoked). > >public static void

Re: How do I turn off Root logging in Log4j2

2016-06-09 Thread Remko Popma
Please take a look at the Architecture manual page, specifically the section on additivity. If you set additivity=false on the Logger configuration the log message will only go to the named logger, and not to the root logger. Sent from my iPhone > On 2016/06/09, at 16:12, Richard Kolb

Re: Cannot load custom plugin with the "packages" configuration property when packaged in a jar file

2016-06-10 Thread Remko Popma
I would prefer a Jira ticket because email quickly drops below the horizon... Sent from my iPhone > On 2016/06/10, at 17:02, Anthony Maire wrote: > > The first log file was obtained for the real plugin (which has dependency to > some code that I can't publish), the

Re: Override log4j.properties during testing

2016-06-15 Thread Remko Popma
Your pom looks wrong: it seems to be using log4j-1.2. Can you try with log4j 2.6.1? Sent from my iPhone > On 2016/06/15, at 22:04, Debraj Manna wrote: > > I want to log only the ERROR during testing in maven. For this purpose I > created a file

Re: Override log4j.properties during testing

2016-06-15 Thread Remko Popma
Please take a look at the log4j2 manual (https://logging.apache.org/log4j/2.x/manual/configuration.html) for how to configure. The documentation is much better than Log4j-1.2. Sent from my iPhone > On 2016/06/15, at 22:29, Remko Popma <remko.po...@gmail.com> wrote: > > Your

Re: BOM dependency with gradle

2016-06-02 Thread Remko Popma
I explicitly specify the version for log4j-api and log4j-core as well. Sent from my iPhone > On 2016/06/02, at 17:03, Greg Thomas wrote: > > Is there a correct syntax to use the BOM dependency with gradle? > > I've currently got the following ... > > compile group:

Re: 2.6 html format - "" inserted in the middle of when restart tomcat

2016-06-01 Thread Remko Popma
Can you raise a Jira ticket for this? That way it won't get lost (email tends to drop off the horizon after a while...) Sent from my iPhone > On 2016/06/02, at 4:51, Emi wrote: > > Hello, > > Updated 2.3 to 2.6. When reload tomcat7, the logfile (html format) not

Re: Question about async logger wait strategies

2016-06-13 Thread Remko Popma
Currently there isn't but there's no real reason not to. That reminds me we should add LiteBlocking (a standard Disruptor wait strategy). Sent from my iPhone > On 2016/06/14, at 5:50, Matt Sicker wrote: > > Also, is there a way to specify a custom WaitStrategy, or is that

Re: Question about async logger wait strategies

2016-06-13 Thread Remko Popma
The busy-spin wait strategy is not something I want to promote since it basically dedicates a full core to the logging background thread. It's there mostly for testing and perhaps for hardcore users who are familiar with the Disruptor. Sent from my iPhone > On 2016/06/14, at 3:24, Matt

Re: Question about how to create new log files on an hourly not depend on new byte stream log appended

2016-06-19 Thread Remko Popma
Allen, Please take a look at the CronTriggeringPolicy. Remko On Mon, Jun 20, 2016 at 12:09 AM, 流子℡ <41157...@qq.com> wrote: > hi, > here is my log config as follows: > > > fileName="game" > filePattern="game.%d{-MM-dd-HH}.log"> > >

Re: OnStartupTriggeringPolicy/custom header

2016-06-15 Thread Remko Popma
Ralph, any objection to making the write methods public? Sent from my iPhone > On 2016/06/16, at 9:05, Leon Finker <leon...@gmail.com> wrote: > > As I remember they are not visible (protected). >> On Jun 15, 2016 7:59 PM, "Remko Popma" <remko.po...@gmail.

Re: OnStartupTriggeringPolicy/custom header

2016-06-15 Thread Remko Popma
I would not use the drain(ByteBuffer) method directly because it would cause that message to appear in the log file ahead of the messages that are currently in the buffer but haven't been flushed yet. Have you looked at the parent OutputStreamManager class? Why not use one of the write(byte[],

Re: Reloading appender after property value changes

2016-06-27 Thread Remko Popma
Have you tried configuring with two leading '$' characters? http://logging.apache.org/log4j/2.x/manual/configuration.html#RuntimeLookup Sent from my iPhone > On 2016/06/28, at 3:17, Benjamin Jaton wrote: > > Hello, > > I have a simple appender like: > > { >

Re: Different Processes, same Logfile

2016-06-25 Thread Remko Popma
I think writing to the same file is possible, but rollover will give unpredictable results. As long as you use the normal FileAppender (not RollingFileAppender) this should work. Also do not use the RandomAccessFile appender, since both processes will overwrite each other's log files. On Sat,

Re: Different Processes, same Logfile

2016-06-25 Thread Remko Popma
I would suggest trying without file locking first. On Sat, Jun 25, 2016 at 4:01 PM, 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

Re: Different Processes, same Logfile

2016-06-25 Thread Remko Popma
If you configure a FileAppender with the locking option set to true, Log4j will do the rest. On Sat, Jun 25, 2016 at 10:45 PM, Jochen Wiedmann wrote: > On Sat, Jun 25, 2016 at 9:01 AM, Ralph

Re: Aw: Re: RollingRandomAccessFile and emtpy log file

2016-02-04 Thread Remko Popma
as expected - of course ;). > Re-trying that on my application seems to work as well. Can't say for sure > what I did wrong back then. > > Sorry for any inconvenience! > > Cheers > Veit > > > Gesendet: Donnerstag, 04. Februar 2016 um 02:19 Uhr > Von: "Remko

Re: Fastest Log4j2 configuration for multiple java process / multiple machine production environment

2016-02-09 Thread Remko Popma
Several of the log4j2 samples use Flume. Have you seen those? Sent from my iPhone > On 2016/02/10, at 9:54, Tara Czutno wrote: > > I have tried getting the Flume Appender to work but no luck yet. The > documentation neglects to tell you what .jars you need. And the

Re: Getter method for retrieving the attributes of an appender from the LoggerContext

2016-01-27 Thread Remko Popma
I agree. It seems like we're preparing to do a lot of work to essentially enable users to duplicate our unit tests... Sent from my iPhone > On 2016/01/28, at 0:44, Mikael Ståldal wrote: > > OK, then the keeping config nodes approach might not be a good idea. > >

Re: Where is it documented that you can supply a Throwable in a varargs log message?

2016-01-29 Thread Remko Popma
Really? I thought ParameterizedMessage took care of that: it checks that the last param is a Throwable. https://logging.apache.org/log4j/2.x/log4j-api/xref/org/apache/logging/log4j/message/ParameterizedMessage.html#L138 StringFormattedMessage also:

Re: RollingRandomAccessFile and emtpy log file

2016-02-03 Thread Remko Popma
I would say immediateFlush but that doesn't explain why you're not seeing the update until after logging 600 KB when the buffer is only 256 KB... Have you tried setting system property -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector to switch on async

Re: Aw: Re: RollingRandomAccessFile and emtpy log file

2016-02-03 Thread Remko Popma
ot)? Or maybe just don't allow starting up log4j when > the configuration is (obviously) wrong :)? > > So I'll check for the async configuration option and report back. > > Thanks! > Veit > > > > > Gesendet: Mittwoch, 03. Februar 2016 um 12:13 Uhr > Von

Re: Aw: Re: Re: RollingRandomAccessFile and emtpy log file

2016-02-03 Thread Remko Popma
; take the buffer into > account? > > Thanks > Veit > > > Gesendet: Mittwoch, 03. Februar 2016 um 13:43 Uhr > Von: "Remko Popma" <remko.po...@gmail.com> > An: "Log4J Users List" <log4j-user@logging.apache.org> > Betreff: Re: Aw: Re: R

Re: RollingRandomAccessFile and emtpy log file

2016-02-03 Thread Remko Popma
- but I will doublecheck and provide a testcase then. > > I haven't experimented with smaller buffer sizes yet. But I'll look into > that too. > > Thanks for your help. > > Veit > >> Am 03.02.2016 um 23:28 schrieb Remko Popma: >> You mention that RollingRandomAc

Re: RollingRandomAccessFile and emtpy log file

2016-02-03 Thread Remko Popma
open to reload the content :)... > > >> Am 04.02.2016 um 00:30 schrieb Remko Popma: >> Was this in Windows? Sometimes Explorer doesn't update until you refresh... >> >> Sent from my iPhone >> >>> On 2016/02/04, at 7:34, Veit Guna <veit.g...@gmx.de&g

Re: Custom appender not identified in OSGi environment

2016-02-03 Thread Remko Popma
Thanks for confirming that. You may avoid the classloader issues by combining the log4j jars and your custom appender in a single jar. The only tricky part here is that you'd need to combine the serialized plugin listing files (see http://logging.apache.org/log4j/2.x/manual/plugins.html)

Re: Async Logger

2016-03-15 Thread Remko Popma
When you say "enables Async logging", what exactly do you mean? What do you observe? Sent from my iPhone > On 2016/03/16, at 11:08, Prasanth Jayachandran wrote: > > Hi All > > We are using log4j2 in Apache Hive project. We are exploring the option of > using Async

Re: Hook into the RollingFileManager#write / Get notice about written bytes

2016-03-12 Thread Remko Popma
Christian, would a JMX interface to this information suit your needs? Currently the AppenderAdminMBean does not provide much (if any) statistics on what was processed. This was partly deliberately because I did not want to build functionality when there's no real need for them and then later find

Re: Hook into the RollingFileManager#write / Get notice about written bytes

2016-03-19 Thread Remko Popma
ctory methods... Not what I like... > > > Best regards, > Christian > > >> Am 13.03.2016 um 01:41 schrieb Remko Popma: >> Christian, would a JMX interface to this information suit your needs? >> Currently the AppenderAdminMBean does not provide much (if any) statistics

Re: Issues with JMX Mbean

2016-03-22 Thread Remko Popma
Hi Thomas, Thanks for reporting these issues. Would you mind raising a Jira ticket for them: I don't have time to investigate at the moment and if there's no Jira ticket they might drop below the mailbox horizon and end up forgotten... Thanks! Remko Sent from my iPhone > On 2016/03/22, at

Re: question

2016-03-24 Thread Remko Popma
Mary, I recommend you raise a Jira ticket for this. I don't know about the other Log4j community members, but I currently don't have time to look into this and without a Jira ticket it may quickly drop below my mailbox horizon... Also, perhaps this is because I'm not a native English speaker, but

Re: Async Appender - Consumer thread dying - new thread unable to start

2016-03-21 Thread Remko Popma
I can't see any attachments. May be a mailing list restriction. Can you raise a Jira and attach the screenshot there? Thanks! Sent from my iPhone > On 2016/03/22, at 1:05, Ron Gonzalez wrote: > > We are seeing a situation where the consumer thread > "AsyncLoggerConfig-1"

Re: is there any way to add a marker to a logger rather than a log

2016-03-28 Thread Remko Popma
The log4j API does not provide a way to "set" a marker that will be emitted on all events produced by that logger. However, one idea is to generate a logger wrapper and write the above logic in the wrapper. Log4j provides a tool to generate logger wrappers for custom log levels. This will

Re: rolled log file continues to grow unbound

2016-03-31 Thread Remko Popma
Simon, To avoid confusion later on, the version of log4j you are using is 1.2.15. The leading "1" is important because it means you're using the previous generation of log4j, which is EOL (end of life) now. If you're doing regression testing to upgrade to Java 8 anyway, may I suggest you

Re: Log4j2 ThreadContext for child threads

2016-04-26 Thread Remko Popma
There you go! It's documented near the bottom of the manual page: http://logging.apache.org/log4j/2.x/manual/thread-context.html Sent from my iPhone > On 2016/04/27, at 8:58, Benjamin Jaton wrote: > > Hi all, > > I am using the ThreadContext a lot, but I am

Re: Questions about RollingFile

2016-05-18 Thread Remko Popma
When you say "with no success", what do you mean? What is actually happening? Remko Sent from my iPhone > On 2016/05/19, at 12:18, Laurent Hasson wrote: > > Hello, > > > > I have the following XML configuration file for my webapp (under Tomcat 9). > > > > > >

Re: is it possible to set container shared lib to use custom loggerContext

2016-07-25 Thread Remko Popma
p logger context. > > Comment? > > > Thanks! > William > > >> On Mon, Jul 25, 2016 at 8:21 AM, Remko Popma <remko.po...@gmail.com> wrote: >> There may be other ways to do this, but if the classes in the sharedLib are >> in a specific package, you could confi

Re: is it possible to set container shared lib to use custom loggerContext

2016-07-25 Thread Remko Popma
There may be other ways to do this, but if the classes in the sharedLib are in a specific package, you could configure the log4j2.xml configurations for both web apps to create a separate appender (and a separate log file) for the loggers for that package. Remko On Sat, Jul 23, 2016 at 3:18 AM,

Re: Logging stops on application redeploy

2016-07-28 Thread Remko Popma
That last paragraph: debug disabled, errors go to the console, sounds like the behavior you get when Log4j2 can't find a configuration file. I wonder how redeploy could cause Log4j to become unable to find the configuration... What do you see when you enable Log4j internal status logging?

<    1   2   3   4   5   >