Re: dynamic configuration

2015-08-07 Thread Ralph Goers
I'd recommend the Configurator class. Ralph On Aug 6, 2015, at 9:46 PM, Gary Gregory garydgreg...@gmail.com wrote: For the simple case where you want to update one level, I think we should have a one method call for folks. Where would be the best place to hang that? Gary

Re: Multi thread initialization problem

2015-08-13 Thread Ralph Goers
;-). Regards. Op 13-8-2015 om 13:58 schreef Ralph Goers: We are seeing your emails. The users list is just generally pretty quiet. Go ahead and create a Jira and attach something that will reproduce the problem. Ralph On Aug 13, 2015, at 12:09 AM, Xen x...@dds.nl wrote: I get

Re: java.lang.NoSuchFieldError: errorHandler

2015-08-13 Thread Ralph Goers
Please see - https://blogs.apache.org/foundation/entry/apache_logging_services_project_announces https://blogs.apache.org/foundation/entry/apache_logging_services_project_announces. Ralph On Aug 13, 2015, at 10:08 PM, Jinhong Lu lujinho...@gmail.com wrote: I met this exception when using

Re: dynamic configuration

2015-08-09 Thread Ralph Goers
. Quoting Ralph Goers ralph.go...@dslextreme.com: Note: in case you didn't know, everyone who submits patches that are applied gets credit for it. See the change log for any release. Without a Jira ticket we can't do that. Ralph On Aug 9, 2015, at 2:28 AM, Gary Gregory garydgreg

Re: my results thus far

2015-08-11 Thread Ralph Goers
One of the principals Log4j 2 tries to follow is to create immutable objects as much as possible as it reduces issues with multi- threading. This means not having setter methods. So you are left with builders, or factory methods and/or constructors with a lot of parameters. Ralph On Aug 11,

Re: Send StatusLogger output to Syslog appender

2015-07-27 Thread Ralph Goers
Gary, This is the StatusLogger. Messages are via StatusListeners. The only one we provide is the StatusConsoleListener. If a user wants to do something else they need to implement their own StatusListener and register it. Ralph On Jul 27, 2015, at 9:52 AM, Gary Gregory

Re: Log4J2 NoSQL query

2015-07-22 Thread Ralph Goers
I am not familiar with Logstash or Fluentd, but I am familiar with Apache Flume. Log4j 2 provides capabilities to write directly to a SQL or some NoSQL databases. Some users prefer to do this, but it does have some risk as to what to do if the target destination becomes unavailable. As Remko

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

2015-07-22 Thread Ralph Goers
hook and it logs stuff from within there. If I put shutdownHook=disable in my log4j2.xml, the problem goes away. But then I guess that Log4j is never shut down properly? On Wed, Jul 22, 2015 at 8:39 AM, Ralph Goers ralph.go...@dslextreme.com wrote: The currentContext value indicates

Re: Log4J2 NoSQL query

2015-07-22 Thread Ralph Goers
I agree with what you are saying here, but there is one other thing I would like to add. One of my motivations for starting work on Log4j 2 was that my employer had a need for a very flexible audit logging system. Most applications I am aware of do their auditing to a database. However, we

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

2015-10-29 Thread Ralph Goers
That feature is only in Log4j 2. Ralph > On Oct 29, 2015, at 1:18 PM, degenaro wrote: > > This a quota on the filesystem. Writes are blocked when the total > permitted bytes for the user is exceeded. It looks like log4j2 might help > if an exception is being thrown.

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

2015-10-29 Thread Ralph Goers
Did you specify ignoreException=false? Ralph > On Oct 29, 2015, at 4:06 PM, Priya Ahuja wrote: > > I am seeing a 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

Re: Change log level on the fly?

2015-11-09 Thread Ralph Goers
Matt, the advice below won’t work properly. The LoggerConfig must be modified, not the Logger. Then updateLoggers must be called (which will update the logger’s level). Ralph > On Nov 9, 2015, at 9:07 PM, Matt Sicker wrote: > > You can find the Logger from LogManager, cast

Re: Change log level on the fly?

2015-11-09 Thread Ralph Goers
We have unit tests that do this. Basically you need to do: final LoggerContext ctx = (LoggerContext) LogManager.getContext(false); final Configuration config = ctx.getConfiguration(); Map loggers = config.getLoggers(); for (Map.Entry logger :

Re: ExceptionInInitializerError with JUL turned on

2015-10-20 Thread Ralph Goers
What version of Java and what version of Log4j? Ralph > On Oct 20, 2015, at 10:57 AM, Mike Calmus wrote: > > I'm trying to add the log4j-jul jar to our configuration. I set the > "java.util.logging.manager" system property as per the documentation in the > server's startup

Re: LoggerContext is reloaded on application shutdown

2015-10-20 Thread Ralph Goers
It happens because something is trying to log something after the LoggerContext has ended. Whatever that is needs to happen before the logging system is shut down. Ralph > On Oct 20, 2015, at 11:16 AM, Benoit Mouquet wrote: > > Exactly, that's why I don't understand

Re: Bizarre performance in log4j2

2015-10-10 Thread Ralph Goers
What does your server look like? Specifically, how many cores? Are they hyper threaded? How much memory? If you don’t have YourKit or some other profiler installed to identify the bottleneck, one of my favorite tricks is to just take several thread dumps 10-15 seconds apart and then compare

[ANNOUNCEMENT] Apache Log4j 2.4.1 released

2015-10-13 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.4.1 release! Apache log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: Logging complete exception trace.

2015-10-06 Thread Ralph Goers
iran Badi >> >> >> On Mon, Sep 21, 2015 at 8:34 AM, Kiran Badi <ad...@aayushs.com> wrote: >> >>> Ok let me build the sample war file for it and see if I can reproduce it >>> outside of my app. >>> >>> Thanks for hint. >>>

Re: Logging complete exception trace.

2015-10-09 Thread Ralph Goers
u said you are seeing. If you want the whole stack trace you have to do: logger.error(“Got SQLException”, ex); HTH, Ralph > On Oct 9, 2015, at 10:16 AM, Ralph Goers <ralph.go...@dslextreme.com> wrote: > > Oh darn. Thanks for the reminder. I forgot to look at it when I got ho

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

2015-10-09 Thread Ralph Goers
Normally you want to create a setenv.bat or setting.sh (depending on your OS) and “set” or “export” CATALINA_OPTS to include all your JVM settings. For example, on a Unix system you would do something like: export

Re: Logging complete exception trace.

2015-10-09 Thread Ralph Goers
h I can change to get it working ? > > On Tuesday, October 6, 2015, Ralph Goers <ralph.go...@dslextreme.com> wrote: > >> I will try to look at it later this evening when I get home from work. >> >> Ralph >> >>> On Oct 6, 2015, at 10:02 AM

Re: Query regarding SocketAppender and SimpleSocketServer

2015-07-07 Thread Ralph Goers
I would suggest that you set the ip address in the ThreadContext at the beginning of each request or operation. Then all log events will contain that information. Sent from my iPad On Jul 7, 2015, at 12:01 AM, Sandeep Dasika dasika.sa...@gmail.com wrote: Hi log4j team, I have been using

Re: range filter?

2015-08-25 Thread Ralph Goers
addition to the FAQ with a description of your use case. Gary On Tue, Aug 25, 2015 at 1:11 PM, Ralph Goers ralph.go...@dslextreme.com wrote: I believe two threshold filters inside a composite filter should should work provided you have the onMatch and onMismatch set appropriately

Re: range filter?

2015-08-25 Thread Ralph Goers
. Seemed to me to be a similar use case to the SO question. Sent from my iPhone On 2015/08/26, at 11:44, Ralph Goers ralph.go...@dslextreme.com wrote: I am not sure why Remko advised you to do it this way. The first filter will deny Warn, error and fatal making the next two filters

Re: range filter?

2015-08-25 Thread Ralph Goers
. Sent from my iPhone On 2015/08/26, at 11:44, Ralph Goers ralph.go...@dslextreme.com wrote: I am not sure why Remko advised you to do it this way. The first filter will deny Warn, error and fatal making the next two filters redundant. The third filter will accept events at level info

Re: redefining existing levels?

2015-08-26 Thread Ralph Goers
Can’t you just put a comment in the config file that states the minimum logging level is info and that it is not to be changed under any circumstances? Ralph On Aug 26, 2015, at 9:27 AM, Nicholas Duane nic...@msn.com wrote: Maybe what I'm trying to do is not that useful. However, I'm

Re: redefining existing levels?

2015-08-26 Thread Ralph Goers
Well, I suppose we could add a minimum logging level system property and if someone tries to set the level lower than that then the minimum level gets used instead. But I’m not really crazy about that as it could cause all kinds of “unexpected” consequences when processing the configuration.

Re: plugins

2015-08-27 Thread Ralph Goers
Can’t you just compare what you wrote to what Gary wrote? If you build your project then it should get packaged in a jar and automatically have the file Log4j uses to quickly load the plugin. Ralph On Aug 27, 2015, at 12:50 PM, Nicholas Duane nic...@msn.com wrote: Based on your previous

Re: plugins

2015-08-27 Thread Ralph Goers
printObject affects the way plugins are logged when you have status=debug enabled. If you set printObject to true then the Plugin’s toString method will be called to log the Plugin’s “name”. Usually, this is just the SimpleClassName, but if the class name doesn’t match the Plugin name it can

Re: custom levels via configuration

2015-08-29 Thread Ralph Goers
the filter. 6. Add the filter to the configuration. You do not need to override the stop method as the filter will be stopped when the whole configuration is stopped. Ralph On Aug 29, 2015, at 9:48 PM, Ralph Goers ralph.go...@dslextreme.com wrote: Ok, but then OFF wouldn’t mean OFF

Re: approach for defining loggers

2015-08-29 Thread Ralph Goers
On Aug 29, 2015, at 7:44 PM, Nicholas Duane nic...@msn.com wrote: I'm curious if there is a prescribed approach to defining loggers. Let me state what my assumption is. I assume that normally if some piece of code wants to log events/messages that it should create a logger for itself.

Re: custom levels via configuration

2015-08-29 Thread Ralph Goers
OFF has a value of 0. What would it mean to have a value less than that? Ralph On Aug 29, 2015, at 7:22 PM, Nicholas Duane nic...@msn.com wrote: I got log4j 2.3 installed and verified that custom levels are working for me now. However, I did noticed you can't set the intValue to a

Re: custom levels via configuration

2015-08-29 Thread Ralph Goers
Ok, but then OFF wouldn’t mean OFF. Ralph On Aug 29, 2015, at 9:41 PM, Nicholas Duane nic...@msn.com wrote: Ideally that I couldn't turn it off. Thanks,Nick Original message From: Ralph Goers ralph.go...@dslextreme.com Date: 08/29/2015 9:51 PM (GMT-07:00) To: Log4J

Re: range filter?

2015-08-26 Thread Ralph Goers
defined a custom level one less than INFO? Wouldn't that end up in the log also? Thanks,Nick Original message From: Ralph Goers ralph.go...@dslextreme.com Date: 08/25/2015 10:28 PM (GMT-07:00) To: Log4J Users List log4j-user@logging.apache.org Subject: Re: range

Re: custom levels via configuration

2015-08-26 Thread Ralph Goers
Custom log levels weren’t added to Log4j 2 until version 2.1, so if the version you are using is older than that it is no surprise that it isn’t working. Ralph On Aug 26, 2015, at 2:34 PM, Nicholas Duane nic...@msn.com wrote: While I work on figuring out how to get a newer version of log4j2

Re: approach for defining loggers

2015-08-31 Thread Ralph Goers
A logging “Level” is a level of importance. That is why there is a hierarchy. If you want informational messages then you also would want warnings and errors. “BUSINESS” does not convey the same meaning. Rather, it is some sort of category, which is what Markers are for. Using the class name

Re: approach for defining loggers

2015-09-01 Thread Ralph Goers
Gary, your examples are great and would be a good addition to the Introduction page. Ralph > On Sep 1, 2015, at 3:47 PM, Gary Gregory wrote: > > On Tue, Sep 1, 2015 at 3:26 PM, Nicholas Duane > wrote: > >> I was re-reading

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

2015-09-01 Thread Ralph Goers
Can you also add status=“DEBUG” to your configuration and provide that? I’d like to see what is being passed through the configuration. Ralph > On Sep 1, 2015, at 4:41 PM, Remko Popma wrote: > > Can you provide your full configuration? (You may want to raise a Jira

Re: approach for defining loggers

2015-09-07 Thread Ralph Goers
I still don’t understand why you don’t want to use Markers. They were designed exactly for the use case you are describing. You might set retention policies for debug vs info, error and fatal, but a BUSINESS marker could cross-cut them all. That is exactly why it is NOT a level. IOW, it

Re: approach for defining loggers

2015-09-08 Thread Ralph Goers
Can you please clarify, “If we had some way to know an event is a business event we wouldn’t need level”? I do not understand how you can code logger.log(BUSINESS, msg) but you cannot code logger.info(BUSINESS, msg). Ralph > On Sep 8, 2015, at 6:09 PM, Nicholas Duane wrote:

Re: approach for defining loggers

2015-09-08 Thread Ralph Goers
The bottom line is it doesn’t matter which log level they use. With the configuration below ALL business events will be accepted, meaning the log level on the logger will not be checked. Then every logger would have a marker filter to accept or deny the event

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

2015-09-02 Thread Ralph Goers
3PKAw8> > > And this is my output from DEBUG on configuration > DEBUG configuration output <http://pastebin.com/bVc8ywB7> > > If this is indeed a bug, I'd like to try and submit a patch :) > > Regards > Sharath > > On Wed, Sep 2, 2015 at 10:06 AM, Ralph Goers

Re: range filter?

2015-08-25 Thread Ralph Goers
I believe two threshold filters inside a composite filter should should work provided you have the onMatch and onMismatch set appropriately. Ralph On Aug 25, 2015, at 12:36 PM, Nicholas Duane nic...@msn.com wrote: I'm looking for a range filter in log4j2. I see there is on in log4net and

Re: range filter?

2015-08-25 Thread Ralph Goers
Subject: Re: range filter? From: garydgreg...@gmail.com To: log4j-user@logging.apache.org When you get it working, it sounds like it would make a nice addition to the FAQ with a description of your use case. Gary On Tue, Aug 25, 2015 at 1:11 PM, Ralph Goers ralph.go...@dslextreme.com

Re: range filter?

2015-08-25 Thread Ralph Goers
@logging.apache.org When you get it working, it sounds like it would make a nice addition to the FAQ with a description of your use case. Gary On Tue, Aug 25, 2015 at 1:11 PM, Ralph Goers ralph.go...@dslextreme.com wrote: I believe two threshold filters inside a composite filter should should

Re: Custom Markers

2015-09-10 Thread Ralph Goers
If I understand you correctly, you have an existing application that logs events in about 5000 different places, so you don’t want to have to modify that code. Without modifying the code the only way to filter the events is on somehow find something wiithin the message itself. If you can add

Re: Custom Markers

2015-09-10 Thread Ralph Goers
will work. You can also create a special logger just for logging the events that are to be routed. However, both of those require that code be modified. Ralph > On Sep 10, 2015, at 2:40 PM, Ralph Goers <ralph.go...@dslextreme.com> wrote: > > If I understand you correctly, you h

Re: Question - RollingFileAppender creates empty files

2015-09-16 Thread Ralph Goers
The files are created as soon as the output stream is opened. This happens when the Appender starts. I’d have to see your configuration to understand why you would be getting multiple files though. Ralph > On Sep 16, 2015, at 7:23 AM, Csilla Fabian wrote: > > Hello, >

Re: approach for defining loggers

2015-09-11 Thread Ralph Goers
.. >>>> >>>> It's confusing as there are n ways to log a business event that way and >>>> they will all do the same thing. Which one should a developer choose. >>>> Should I say pick any one, it doesn't matter? >>>> >>>> Thanks

Re: approach for defining loggers

2015-09-11 Thread Ralph Goers
> On Sep 11, 2015, at 3:50 PM, Gary Gregory wrote: > > > This updated text I hope will help: > > "No new loggers needed, just an additional parameter to your log call, > regardless of the level API used. > > Now, I can configure Log4j to log only events that contain

Re: Structured data appearing twice

2015-09-15 Thread Ralph Goers
Can you describe your use case in a bit more detail? Maybe we can provide some other ideas on how to resolve it. Ralph > On Sep 15, 2015, at 12:17 PM, Priya Ahuja wrote: > > Thanks Gary! I will update after trying with 2.3. I have a mild idea on > what may be going

Re: markers

2015-09-16 Thread Ralph Goers
I actually haven’t looked at log4net, but since it predates Log4j 2 I would imagine it is missing the new features we added. Using your own custom messages is certainly a viable approach. But there again, logging Message objects instead of simple strings is something that was introduced by

Re: Why is log4net not more similar to log4j(2)?

2015-09-16 Thread Ralph Goers
Well, it might be huge but I’m guessing it would be a lot of fun! Ralph > On Sep 16, 2015, at 5:06 PM, Nicholas Duane wrote: > > Not sure. I was going to ask what a guess on the effort might be. I wasn't > expecting *huge*. And I guess *huge* is still your guess if we only

Re: Question - RollingFileAppender creates empty files

2015-09-17 Thread Ralph Goers
e appender, >> but some appenders might be unused by the system, that's why there are >> empty log files. >> But I think you answered my question, it's not possible to set up the >> appender in the XML config file to create the log file only in case if >> there's something

Re: Jar in WEB-INF/lib not logging

2015-09-29 Thread Ralph Goers
By changing the package name did you cause the Logger name to change? Do you have that logger name configured so that it will log? Ralph > On Sep 29, 2015, at 4:37 PM, Thad Humphries wrote: > > I am using Log4j 2.4 to log server actions in my webapp. The logging

Re: Jar in WEB-INF/lib not logging

2015-09-29 Thread Ralph Goers
geToPdf. > > Nothing but /Configuration/Loggers/Logger/@name holds that servlet package > name, and (AFAIK) that is not required--name can be whatever I want. I > tried adding a similar but with com.thad.image.utils, and tried > adding /Configuration/@name = "com.thad.gwtapp.server, > com.thad

Re: Jar in WEB-INF/lib not logging

2015-09-29 Thread Ralph Goers
s was com.thad.gwtapp.server.ImageToPdf but is now >> com.thad.image.utils.ImageToPdf. When I run the webapp in Eclipse, logs for >> com.thad.gwtapp.server.* are there, but not com.thad.image.utils.ImageToPdf. >> >> Nothing but /Configuration/Loggers/Logger/@name holds that

Re: TriggeringEventEvaluator alternative for Log4j2

2015-09-27 Thread Ralph Goers
In hindsight I think it was a mistake to use a filter in place of the TriggeringEventEvaluator when SmtpAppender was ported from Log4j 1. The impact of this is that Filters on the SmtpAppender no longer work the way you want. Your GatheringFilter is going to cause events 1-19 to be buffered

Re: global context properties

2015-09-19 Thread Ralph Goers
Take a look at RFC5424Layout. On the @PluginFactory method you will see a Configuration parameters annotated with @PluginConfiguration. If you include this in your factory method parameter list Log4j will automatically pass you the current Configuration object. From that you can call the

Re: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Ralph Goers
Nick, You ask and discuss on the dev list. The number of developers isn’t that large so it should be readily apparent if there is interest. That said, Log4j 1.x was pretty dormant when I started working on Log4j 2. I worked for almost 18 months before I committed anything just because I

Re: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Ralph Goers
To answer your last question, at the ASF the project committers decide what they are going to do. They make decisions by discussing their ideas on the mailing list. In some ways, the ASF is a “do-ocracy”. You can make all the recommendations you want, but ultimately it is up to whoever

Re: log4j2 will not start on tomcat 7 with a web app version 2.5

2015-09-23 Thread Ralph Goers
Do you have the log4j-web jar in your classpath? Ralph > On Sep 23, 2015, at 5:20 PM, Karl D. Kelley Jr. > wrote: > > First, I am sorry to have to post this. I have read everything I can get my > hands on from the internet and do not understand the issue I am having.

[ANNOUNCEMENT] Apache Log4j 2.4 released

2015-09-24 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.4 release! Apache log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: Migrating from log4j to log4j2

2015-12-02 Thread Ralph Goers
rg.apache.log4j.Priority) >> >> >> Setting the log level is a topic usually address by calling the >> Configurator class. >> >> Gary >> >> >>> >>> >>> getTarget >>> >>> >> https://logging.apac

Re: programmatically change max file size of RollingFileAppender

2015-12-08 Thread Ralph Goers
This was fixed in LOG4J2-381. Unfortunately that is in the 2.5 release so would require Java 7. I suppose you could back port the fix to 2.3. Ralph > On Dec 8, 2015, at 9:56 PM, Dave Glasser wrote: > > > > I'm using Log4j 2.3, rather than the latest 2.x version, because

Re: Migrating from log4j to log4j2

2015-12-02 Thread Ralph Goers
I’m not sure what you are trying to do with the pattern is necessary. The latest version of Log4j supports a PatternSelector that should provide what you need. I am not sure why the updating of the ConsoleAppender is necessary. Why can’t that just be configured? Ralph > On Dec 2, 2015, at

Re: Recursive call to appender stackoverflow error

2015-12-11 Thread Ralph Goers
The error message regarding the recursive call indicates that an appender is logging an event which is being routed to the same appender. Log4j detects that and ignores the logging event. But without seeing a stack trace it would be impossible to guess what is going on. I can’t even tell what

Re: Adding custom fields dynamically to the JSON layout output.

2015-12-16 Thread Ralph Goers
The approach I would use is to implement a JSONMessage class or JSONMapMessage class (which seems reasonable that we should have) and then you would do log.debug(new JSONMapMessage(map)); JSONMapMessage would override MapMessage’s asString() method to have it return asString(MapFormat.JSON);

Re: status appender?

2015-12-14 Thread Ralph Goers
First, what you are wanting to do is, in fact, pretty normal. However, by default the StatusLogger that Log4j uses for its components doesn’t use an Appender. Although the API is the same the internals of the StatusLogger are actually quite different than the “normal” Log4j implementation.

Re: still: Memoryleak - org.apache.log4j.helpers.ThreadLocalMap

2015-12-17 Thread Ralph Goers
Yes, and some of the patches and fixes from 2.4+ can be back ported to 2.3.1, etc if there is interest and anyone is willing to help out. Ralph > On Dec 17, 2015, at 1:16 PM, Gary Gregory wrote: > > Hello, > > Log4j 1 has reached EOL. For Java 6 support you can use

Re: still: Memoryleak - org.apache.log4j.helpers.ThreadLocalMap

2015-12-17 Thread Ralph Goers
The configuration format has changed. It had to due to the plugin system that log4j 2 uses and because there are many new features and so many things were implemented differently. Ralph > On Dec 17, 2015, at 2:29 PM, Veit Guna wrote: > > Hi Gary. > > I can give it a try

[ANNOUNCEMENT] Apache Log4j 2.5 released

2015-12-10 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.5 release! Apache log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: status appender?

2015-12-14 Thread Ralph Goers
I don’t think I understand - “we’re writing to our own logger within our DomainSocketAppender”. The status logger in your appender should only be logging errors or other events that occur within that Appender, which normally would be nothing. Routing events being processed by an Appender

Re: Dead link on front page

2015-12-09 Thread Ralph Goers
The only page I can think of that that might be would be http://logging.apache.org/log4j/1.2/manual.html . Ralph > On Dec 9, 2015, at 9:45 AM, Thibault, Daniel > wrote: > >

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

2016-01-04 Thread Ralph Goers
Please see https://blogs.apache.org/foundation/entry/apache_logging_services_project_announces . Ralph > On Jan 4, 2016, at 11:14 PM, Anshu Garg1 wrote: > > Hi, > > We have extended

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

2016-01-05 Thread Ralph Goers
more specific please? >> >> >>> >>> All above needed to write own classes with most functionality copied from >>> Apache which means we could not achieve above with just extending the >>> Apache classes. We had to make source code changes whic

Re: Dispatcher logs not going to log4j

2015-12-21 Thread Ralph Goers
I believe this error is coming from Tomcat, not Spring. You would need to modify Tomcat to route its logs through Log4j to get it. Ralph > On Dec 21, 2015, at 12:30 PM, Karl D. Kelley Jr. > wrote: > > Logging from org.springframework.web.servlet.DispatcherServlet

Re: Trigger RollingRandomAccessFile appender programmtically?

2015-12-21 Thread Ralph Goers
Log4j 2.5 added a CronTriggeringPoilicy that triggers a rollover when the specified time pattern matches. You could look at that and create your own triggering policy that triggers on whatever your criteria is. As an alternative you can locate the Appender in the configuration, obtain its

Re: Trigger RollingRandomAccessFile appender programmtically?

2015-12-21 Thread Ralph Goers
You would define it as a plugin. Look at how the CronTriggeringPolicy does it. Ralph > On Dec 21, 2015, at 2:22 PM, John Lussmyer wrote: > > I can easily write an "OnDemandTriggeringPolicy" class that implements > TriggeringPolicy. > I just don't see how I can get the

Re: still: Memoryleak - org.apache.log4j.helpers.ThreadLocalMap

2015-12-18 Thread Ralph Goers
live without the monitoring since the xml is packaged within a > jar anyway. But that might change in the future. > > Regards, > Veit > > > > > Gesendet: Freitag, 18. Dezember 2015 um 02:10 Uhr > Von: "Ralph Goers" <ralph.go...@dslextr

Re: still: Memoryleak - org.apache.log4j.helpers.ThreadLocalMap

2015-12-17 Thread Ralph Goers
Although the configuration format has changed, it shouldn’t be too difficult to figure out how to create a similar configuration in Log4j 2. If you have any problems at all please ask. We will be happy to help with that. Ralph > On Dec 17, 2015, at 2:29 PM, Veit Guna wrote:

Re: StatusLogger

2015-11-30 Thread Ralph Goers
Log4j2 logs Message objects. The object being logged is contained within the message. You would normally call getFormattedMessage() to get the message String if that is what you are after. Ralph > On Nov 30, 2015, at 7:10 AM, Nicholas Duane wrote: > > Is there a way within an

Re: StatusLogger

2015-11-30 Thread Ralph Goers
From Log4j’s perspective, what is logged is the Message. Each message may have a different way of encapsulating its information. Ralph > On Nov 30, 2015, at 8:33 AM, Nicholas Duane wrote: > > I'm not necessarily after the string. I'm trying to get the original object > that

Re: StatusLogger

2015-11-30 Thread Ralph Goers
on the MessageFactory specified on the Logger. It also could be an RFC5424 Message or a MapMessage in which case the Message will contain a Map of data elements. Users can also create their own Message types. Ralph > On Nov 30, 2015, at 12:46 PM, Ralph Goers <ralph.go...@dslextreme.com> wrote:

Re: StatusLogger

2015-11-30 Thread Ralph Goers
epending >> on the MessageFactory specified on the Logger. It also could be an RFC5424 >> Message or a MapMessage in which case the Message will contain a Map of data >> elements. Users can also create their own Message types. >> >> Ralph >> >>>

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

2015-11-27 Thread Ralph Goers
So in your code you have Logger logger = LogManager.getLogger(“Info”); logger.info(“blah blah blah”); and Logger logger = LogManager.getLogger(“Console Output”); logger.debug(“a debug message”); ? Those are very strange logger names. Ralph > On Nov 27, 2015, at 1:02 AM, Pranaya Behera

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

2015-11-27 Thread Ralph Goers
mport org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final > Loggerlogger = LoggerFactory.getLogger(User.class); logger.error("Error", > exception); > > I am using slf4j with log4j2-impl. Is the code part wrong ? >> On Friday 27

Re: StatusLogger

2015-11-20 Thread Ralph Goers
You can also use a normal logger in your appender for stuff that will happen at runtime. You just have to be aware that if you have things configured incorrectly that may result in a loop - at which point Log4j will detect it and ignore those logging events. Ralph > On Nov 20, 2015, at 10:55

Re: StatusLogger

2015-11-20 Thread Ralph Goers
What do you mean by “capture the events from our appenders”? The StatusLogger is primarily used during configuration or to log errors that occur in the appender. If you are trying to capture the events being logged that sounds a bit odd as that is the purpose of an appender. If you want to

Re: StatusLogger

2015-11-20 Thread Ralph Goers
OK - so it sounds like you are fine. Ralph > On Nov 20, 2015, at 11:24 AM, Nicholas Duane wrote: > > That's what we're doing. The appender it writing to a logger and via the > configuration we have that going to this http endpoint. We're careful to > ensure that the events

Re: Suppressing exception trace to exception message only

2015-11-19 Thread Ralph Goers
Please see http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout . You can specify %ex{short.message} Ralph > On Nov 19, 2015, at 6:01 PM, Priya Ahuja wrote: > > Hi, > > I am

Re: StatusLogger

2015-11-19 Thread Ralph Goers
Yes, the StatusLogger is how Log4j logs things that happen within Log4j itself. If you are writing plugins for Log4j those should also use the StatusLogger as they effectively become part of Log4j. If the are regular application code then they should not use the StatusLogger. Although the

Re: Does anyone use Log4j2 with Logstash?

2015-11-19 Thread Ralph Goers
The only problem I have is with the number of integrations we could do. ElasticSearch and Solr are similar, and Solr is an Apache project, so I would expect we would want to support both if we support either. Ralph > On Nov 19, 2015, at 10:07 AM, Gary Gregory wrote: >

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

2016-06-09 Thread Ralph Goers
erClass.newInstance(); > > (and it does not fail) > > => With the .java file in eclipse, the plugin is correctly loaded, but with > the jar file in the classpath only, no plugin is loaded > > > > > 2016-06-09 18:54 GMT+02:00 Ralph Goers <ralph.go...@dslextreme.

[ANNOUNCEMENT] Log4j 2.6.1 released

2016-06-09 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.6.1 release! Apache log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as

Re: About onStartTriggeringPolicy for 2.6.1

2016-06-13 Thread Ralph Goers
Well, OnStartupTriggeringPolicy is supposed to cause a roll over at startup, so if it wasn’t it was a bug. The only time it does not perform the roll over is if the file size is 0. If you would like a minimum size criteria to be added please create a Jira issue for that. Ralph > On Jun 13,

Re: OnStartupTriggeringPolicy/custom header

2016-06-15 Thread Ralph Goers
I can add an option to the OnStartupTriggeringPolicy to only roll if the file meets or exceeds a minimum value. The default would be 1 byte. Also, I believe I introduced another bug. The file is now going to roll every time a reconfiguration takes place, which is obviously incorrect. I need to

Re: Override log4j.properties during testing

2016-06-15 Thread Ralph Goers
You are using log4j 1.2.17, which reached end-of-life last year. We recommend you upgrade to Log4j 2 since we no longer support log4j 1. Ralph > On Jun 15, 2016, at 6:04 AM, Debraj Manna wrote: > > I want to log only the ERROR during testing in maven. For this

Re: OnStartupTriggeringPolicy/custom header

2016-06-15 Thread Ralph Goers
Buffer), is that the one to use? Writing from triggering policy > seems to be the easiest way in our case. > > On 2016-06-15 12:25 (-0400), Ralph Goers <ralph.go...@dslextreme.com> wrote: >> I can add an option to the OnStartupTriggeringPolicy to only roll if the >> file me

Re: BOM dependency with gradle

2016-06-02 Thread Ralph Goers
I have no idea what Gradle does to support the import scope, but as I recall that was added to Maven before Gradle existed. > On Jun 2, 2016, at 9:36 AM, Matt Sicker wrote: > > I'm not sure if BOMs work outside Maven as it's based on a Maven-specific > feature that Ralph was

<    1   2   3   4   5   6   7   8   9   10   >