Re: User-based logger level

2012-06-11 Thread Ralph Goers
In Log4j 2 the DynamicThresholdFilter can be specified a) globally (equivalent to Logback's TurboFilter) b) on a Logger c) in the Appender Reference in a Logger and d) on an Appender. For your use case you could specify the DynamicThresholdFilter on each Logger and you would get the effect you

[ANNOUNCEMENT] Apache Logging log4j 2.0-alpha1 released

2012-08-05 Thread Ralph Goers
The Apache Logging team is pleased to announce the Apache log4j 2.0-alpha1 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 of the

Re: [2.X] Null object returned for root

2012-08-07 Thread Ralph Goers
Can you post your logging configuration file? This error usually means it can't find a plugin for the object. That would be very odd for the root logger. Ralph Sent from my iPad On Aug 7, 2012, at 1:46 AM, Simone Tripodi simonetrip...@apache.org wrote: Hi all mates! Congrats first for

Re: [2.X] Null object returned for root

2012-08-07 Thread Ralph Goers
://simonetripodi.livejournal.com/ http://twitter.com/simonetripodi http://www.99soft.org/ On Tue, Aug 7, 2012 at 3:39 PM, Ralph Goers rgo...@apache.org wrote: Can you post your logging configuration file? This error usually means it can't find a plugin for the object. That would be very odd for the root logger

Re: [2.X] Null object returned for root

2012-08-07 Thread Ralph Goers
Absolutely. Error handling in general probably needs attention. Ralph On Aug 7, 2012, at 9:04 AM, Scott Deboy wrote: Would be good to catch this and provide a more descriptive error in cases like this as well. On Tue, Aug 7, 2012 at 8:33 AM, Ralph Goers ralph.go...@dslextreme.comwrote

Re: log4j2: building trunk

2012-08-20 Thread Ralph Goers
Are you running mvn eclipse:eclipse? If so, run mvn install first. That will install the artifacts into your local repository so that the eclipse goal can find them. Ralph On Aug 20, 2012, at 9:03 AM, Rainer Hirschmiller wrote: Hi, trying to build the trunk I got an error. Here is my

Re: log4j2: building trunk

2012-08-20 Thread Ralph Goers
I should add, though, that I have a suspicion that the error is due to our locale differences. Ralph On Aug 20, 2012, at 10:00 AM, Ralph Goers wrote: First, would you please look in log4j12-api\target\surefire-reports for org.apache.log4j.LoggerTest.txt and attach that so I can see why

Re: Log4j : how to classify loger messages

2012-08-22 Thread Ralph Goers
I found this link which seems to be exactly on topic - http://www.coderanch.com/t/62444/open-source/log-properties. The short answer is that you want to use the LevelMatchFilter but that can only be used with an XML configuration. Ralph On Aug 22, 2012, at 6:54 AM, adicj wrote: hi all,

Re: Comparison log4j 2 with log4j 1.2.17

2012-08-25 Thread Ralph Goers
These are very good questions - in fact I should probably add them as FAQs to the web site. Log4j 2 is very new. Currently, the only article written about it is in German in a recent issue of Java Magazine -

Re: Issue with setting the XMLConfiguration after the LoggerContext is initialized

2012-08-29 Thread Ralph Goers
Since you are manually setting up the configuration and then calling setConfiguration() you don't want to call reconfigure(). setConfiguration() will perform the reconfiguration with the config you provided. reconfigure() will try to locate the configuration file using the normal mechanism and

Re: Issue with setting the XMLConfiguration after the LoggerContext is initialized

2012-08-29 Thread Ralph Goers
On Aug 29, 2012, at 12:58 PM, Ralph Goers wrote: Since you are manually setting up the configuration and then calling setConfiguration() you don't want to call reconfigure(). setConfiguration() will perform the reconfiguration with the config you provided. reconfigure() will try to locate

Re: log4j2 getting started rolling files

2012-08-29 Thread Ralph Goers
Thanks for downloading Log4j 2 and working with it! RollingFileAppender currently doesn't support a listener but I see no reason it couldn't. Feel free to create a Jira issue for this feature. If you would like to implement it as well that would be fantastic! Ralph On Aug 29, 2012, at 2:26

Re: log4j2 getting started rolling files

2012-08-29 Thread Ralph Goers
the RollingFileManager. This method takes care of actually performing the renaming of files, etc. You can already extend this class and override that method to perform work before or after doing super.rollover(fileManager). Would this fulfill your need? Ralph On Aug 29, 2012, at 2:35 PM, Ralph Goers wrote

Re: log4j 2.x configuration not found

2012-09-06 Thread Ralph Goers
Try renaming it to log4j2.xml. Ralph On Sep 6, 2012, at 7:47 AM, Adam Furmanczuk wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Probably this issue has been raised before, but could not find any hint: I wanted to use the new log4j 2.x in my JSF webproject, but it fails to

Re: log4j 2.x configuration not found

2012-09-07 Thread Ralph Goers
Thanks, I was going through the documentation with some of coworkers yesterday and found some other issues as well. I will try to get these addressed before the next release. Ralph On Sep 7, 2012, at 11:18 AM, Adam Furmanczuk wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Ralph,

Re: [OT] logging parallel threads

2012-10-16 Thread Ralph Goers
Why does the output have to be XML? It would be far simpler if you could record the events in some other way and then generate the reports (or whatever you need in XML). To give you an idea, the architecture I am using (and why I have put so much effort into Log4j 2) is; 1. Audit events

Re: Adding appenders in a custom ConfigurationFactory (log4j 2)

2012-10-18 Thread Ralph Goers
Doing what you have below seems like a very sledgehammer-like approach. If you have something you can key on it would make more sense to use either a) configure both appenders and filter them based on the process. b) use the RoutingAppender to more or less do the same as option a but in a more

Re: Adding appenders in a custom ConfigurationFactory (log4j 2)

2012-10-18 Thread Ralph Goers
One other issue that occurs to me is that you have a monitorInterval of 30 specified. if the file is updated a new XMLConfiguration will be created that will not have your custom appender in it. Ralph On Oct 18, 2012, at 8:34 AM, Ralph Goers wrote: Doing what you have below seems like a very

Re: log4j2 integration with Hadoop using log4j

2012-10-19 Thread Ralph Goers
I've gotten the embedded agent working. It is a bit messy with dependency management. Here is a sample pom. I will add this to the documentation. project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

Re: log4j2 integration with Hadoop using log4j

2012-10-19 Thread Ralph Goers
. On Fri, Oct 19, 2012 at 11:02 AM, Ralph Goers ralph.go...@dslextreme.comwrote: I've gotten the embedded agent working. It is a bit messy with dependency management. Here is a sample pom. I will add this to the documentation. project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi

Re: log4j2 integration with Hadoop using log4j

2012-10-19 Thread Ralph Goers
both log4j and log4j2 to log via log4j2 implementation in my application code? On Fri, Oct 19, 2012 at 11:52 AM, Ralph Goers ralph.go...@dslextreme.comwrote: As shown below, the log4j12-api jar replaces log4j.jar and passes all the Log4j 1.x logging calls to Log4j 2. This is usually what

Re: log4j2 integration with Hadoop using log4j

2012-10-19 Thread Ralph Goers
parameters than Log4j 1.x. On Oct 19, 2012, at 1:18 PM, Zhu Wayne wrote: That is a good news. Could I still use log4.properties instead of JSON or XML format? On Fri, Oct 19, 2012 at 3:14 PM, Ralph Goers ralph.go...@dslextreme.comwrote: The log4j 1.x adapter should allow an application that logs

Re: Two classes, logging to the same file...

2012-10-22 Thread Ralph Goers
DePasquale wrote: Yep, both in one jar (mine), with the two log4j2 jars in the /lib/ext area. Will have to work on the zip and get back to you On Mon, Oct 22, 2012 at 10:38 PM, Ralph Goers ralph.go...@dslextreme.com wrote: In theory, what you are describing should be working. Are the two

Re: Two classes, logging to the same file...

2012-10-22 Thread Ralph Goers
: Yep, both in one jar (mine), with the two log4j2 jars in the /lib/ext area. Will have to work on the zip and get back to you On Mon, Oct 22, 2012 at 10:38 PM, Ralph Goers ralph.go...@dslextreme.com wrote: In theory, what you are describing should be working. Are the two classes in one

Re: Two classes, logging to the same file...

2012-10-23 Thread Ralph Goers
org.comtor.drivers) and that works. Thus, my issue apparently is specific to this particular one class. Debugging continues as I have the time. On Tue, Oct 23, 2012 at 3:47 AM, Ralph Goers ralph.go...@dslextreme.com wrote: I copied the log4j api and core jars into /System/Library/Frameworks

Re: Two classes, logging to the same file...

2012-10-23 Thread Ralph Goers
OK - I tried my theory and didn't have any problems. Ralph On Oct 23, 2012, at 10:59 AM, Ralph Goers wrote: That is good to know. However, your test has spawned a suspicion that the problem may be related to one class starting with the name of the other. Try renaming Comtor

Re: Two classes, logging to the same file...

2012-10-23 Thread Ralph Goers
have to I will. Thanks for the help! On Tue, Oct 23, 2012 at 2:36 PM, Ralph Goers ralph.go...@dslextreme.com wrote: OK - I tried my theory and didn't have any problems. Ralph On Oct 23, 2012, at 10:59 AM, Ralph Goers wrote: That is good to know. However, your test has spawned

Re: Flume Appender

2012-10-25 Thread Ralph Goers
As Christian pointed out, Log4j 2 is still considered beta quality software. While it works fine in the environments I have tested in others are starting to use it in other environments and as they encounter problems and fixes are implemented the quality will improve.That said, I am using the

Re: Two classes, logging to the same file...

2012-10-29 Thread Ralph Goers
Did you make any progress on this? Ralph On Oct 23, 2012, at 1:21 PM, Peter J. DePasquale wrote: Debugging on the train it's in the name of the class More later Ralph Goers ralph.go...@dslextreme.com wrote: BTW - I just want to make sure that you are aware that instead

Re: Two classes, logging to the same file...

2012-10-29 Thread Ralph Goers
distracted from my ability to work on this problem. Sent from my iPad On Oct 29, 2012, at 10:11 PM, Ralph Goers ralph.go...@dslextreme.com wrote: Did you make any progress on this? Ralph On Oct 23, 2012, at 1:21 PM, Peter J. DePasquale wrote: Debugging on the train it's

Re: Correct location for log4j2.xml file in war?

2012-11-03 Thread Ralph Goers
Please post your configuration, what release are you using? Ralph On Nov 3, 2012, at 6:58 PM, Peter DePasquale peter.depasqu...@gmail.com wrote: Thanks. Now I'm getting the following at run time: java.lang.NullPointerException

Re: Hosted API 404

2012-11-03 Thread Ralph Goers
Thanks, I fixed those this morning and they will be updated in the next release. The correct links should be log4j-api/apidocs instead of log4j2-api/apidocs. Ralph On Nov 3, 2012, at 5:16 PM, Peter DePasquale wrote: Hi, I'm trying to view the API docs for Log4j2 via the web site and I'm

Re: Correct location for log4j2.xml file in war?

2012-11-04 Thread Ralph Goers
/3fc48278d07619c37164260069d77a1b/ On Sun, Nov 4, 2012 at 12:55 AM, Ralph Goers rgo...@apache.org wrote: Please post your configuration, what release are you using? Ralph On Nov 3, 2012, at 6:58 PM, Peter DePasquale peter.depasqu...@gmail.com wrote: Thanks. Now I'm getting the following at run time

Re: Correct location for log4j2.xml file in war?

2012-11-04 Thread Ralph Goers
/ /logger logger name=org.comtor.analyzers level=trace additivity=false appender-ref ref=analyzers/ /logger /loggers /configuration On Sun, Nov 4, 2012 at 8:02 AM, Ralph Goers ralph.go...@dslextreme.comwrote: Can you just paste it in the email? What is at the link isn't really

Re: Correct location for log4j2.xml file in war?

2012-11-04 Thread Ralph Goers
is attempting to be created, but I'm thinking that is the cause of the subsequent failure to obtain the logger. (Earlier shown error messages are the same.) How should I reference the log file creation location in the logger config? On Sun, Nov 4, 2012 at 8:40 AM, Ralph Goers ralph.go

Re: Correct location for log4j2.xml file in war?

2012-11-04 Thread Ralph Goers
environment? I'm trying to use one log config file for local execution through a jar file, and also to support deployment via Tomcat. Or is the easiest thing to have two separate log config files, one for each type of execution? On Sun, Nov 4, 2012 at 9:08 AM, Ralph Goers ralph.go

Re: Flume-Appender

2012-11-14 Thread Ralph Goers
) at de.simo.Log4j2FlumeEmbedded.main(Log4j2FlumeEmbedded.java:22) Can anybody create a very small project (just 1 message with a embedded agent) to show me what i have to do? :/ To use other appender is very easy, but the flume appender... thank you 2012/11/13 Ralph Goers ralph.go...@dslextreme.com

[ANNOUNCEMENT] Apache Logging log4j 2.0-beta3 released

2012-11-14 Thread Ralph Goers
The Apache Logging team is pleased to announce the Apache log4j 2.0-beta3 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 of the

Re: log4j2 and encoding

2012-11-24 Thread Ralph Goers
Most Layouts accept a charset attribute. You should try specifying ISO-8859-1 there. If that doesn't work please let us know. Ralph On Nov 24, 2012, at 11:37 AM, Rainer Hirschmiller wrote: Hi, I'm using Windows 7, Java 7 and Log4j2 beta3 and Eclipse Juno. I'm reading data from a

Re: log4j2 and encoding

2012-11-24 Thread Ralph Goers
Where are you finding MyApp? A class with that name occurs in several places on the web site. Many of them are meant to be code fragments and are not full applications. Ralph On Nov 24, 2012, at 6:41 PM, Feng Ye wrote: I'm using Windows 7, Java 7 and Log4j2 beta3 and Eclipse Juno. A

Re: Flume Appender

2012-12-04 Thread Ralph Goers
I will check with the QA engineer who ran our tests. However, you might want to test with Flume 1.3.0 which was just released. We actually use the CDH version of Flume from Cloudera and so our tests had many of the fixes that are in 1.3. I'm not sure what if what we were measuring is what you

Re: Flume Appender

2012-12-04 Thread Ralph Goers
. If the application terminates before the embedded agent completes its work some of the events will be left in the File Channel so it may appear you are losing events. We had to add a wait to the end of our application to verify all the events were delivered. Ralph On Dec 4, 2012, at 7:16 AM, Ralph

Re: exception logging

2012-12-04 Thread Ralph Goers
No, you aren't confused. When the EnhancedPatternLayout was incorporated from Log4j 1.x it doesn't actually do that. In looking at the code it turns out the WriterAppender is formatting the throwable, not the PatternLayout. That behavior isn't correct. If you could create a Jira issue for

Re: Map Lookup Question

2012-12-21 Thread Ralph Goers
I know this isn't intuitive but you need to add a second '$ and make it $${ctx:id}. This is because the variables are replaced first when the configuration file is read. However, you want this variable to be resolved at runtime, not when the configuration is parsed. With two dollar sign

Re: Map Lookup Question

2012-12-21 Thread Ralph Goers
Hmm. I just noticed that your question is about the file name. Are you running with beta3? I thought that issue had been brought up in an earlier beta and fixed. Ralph On Dec 21, 2012, at 4:23 PM, Michael Minella wrote: I'm looking at the log4j 2 's thread specific features and had a

Re: Map Lookup Question

2012-12-22 Thread Ralph Goers
groupIdorg.apache.logging.log4j/groupId artifactIdlog4j-core/artifactId version2.0-beta3/version /dependency Thanks, Michael T Minella - Original Message - From: Ralph Goers ralph.go...@dslextreme.com To: Log4J Users List log4j-user

Re: Map Lookup Question

2012-12-23 Thread Ralph Goers
I started thinking about this and realized I have given you an incorrect answer. The file appender is initialized when the configuration is processed and is not reevaluated for every event. Thus giving it a variable with 2 '$' characters doesn't make sense. Likewise, when the configuration is

Re: Map Lookup Question

2012-12-24 Thread Ralph Goers
... Thanks, Michael T Minella - Original Message - From: Ralph Goers ralph.go...@dslextreme.com To: Log4J Users List log4j-user@logging.apache.org Sent: Sunday, December 23, 2012 2:15:15 PM Subject: Re: Map Lookup Question I started thinking about this and realized I have given

Re: Flume Appender

2012-12-27 Thread Ralph Goers
some time on it. You mean to say even for a simple class which logs some statements i need to use maven. Can I do this without maven ? I'm asking too many questions in order to make sure that I'm not on wrong track..!! Pradeep -Original Message- From: Ralph Goers [mailto:ralph.go

Re: Flume Appender

2012-12-28 Thread Ralph Goers
Exiting the application Even after this No appenders found for logger WARN message data is being written HDFS but it is junk. -Original Message- From: Ralph Goers [mailto:ralph.go...@dslextreme.com] Sent: Thursday, December 27, 2012 9:31 PM To: Log4J Users List Subject

Re: Redirecting Log4j2 to SLF4J?

2013-01-02 Thread Ralph Goers
On Jan 2, 2013, at 8:53 AM, Robert Elliot wrote: Hi, I've been browsing the Log4j2 site, and the documentation is unsurprisingly very focussed on people using the Log4j2 API directly. Given the profile of Apache Log4j as brands this means we will almost certainly very soon see

Re: Is logging operation blocking or nonblocking?

2013-01-03 Thread Ralph Goers
On Jan 3, 2013, at 9:58 PM, Suat Gönül wrote: Hello everyone, I have a basic question: Is the execution of log4j blocking or nonblocking? Assume that I have the following code snippet logging a large string: ... Logger logger = Logger.getLogger(SomeClass.class); String s = string

Re: log4j Redis appender

2013-01-09 Thread Ralph Goers
Can you guys add links to a wiki page? I'm likely to forget about these emails and I'm not sure we should open a Jira issue for these at this point. Ralph On Jan 9, 2013, at 8:44 AM, Christian Grobmeier wrote: On Sun, Jan 6, 2013 at 9:25 PM, Gary Gregory garydgreg...@gmail.com wrote: I read

Re: Release time line for 2.0

2013-01-29 Thread Ralph Goers
The current release is Log4j 2.0 beta3. Log4j 2.0 beta4 is in the process of being voted on and will be available later this week. As for when a final 2.0 GA release will be done, that is up to the community to decide. I recently asked if the next release should be 2.0 GA and the preference

[ANNOUNCEMENT] Apache Log4j 2.0.beta4 released

2013-02-01 Thread Ralph Goers
The Apache Logging team is pleased to announce the Apache log4j 2.0-beta4 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 of the

Re: log4j2.0 - beta4 MDC.put(String, String) method not found

2013-02-07 Thread Ralph Goers
The MDC class in log4j-1.2-api does have the method. Are you sure you have the correct jars? What is processing the log4j configuration and emitting the messages? It looks like something is passing a log4j 2 configuration to log4j 1.x. Ralph On Feb 7, 2013, at 2:16 PM, Yogi Nerella wrote:

Re: 2.0-Beta4

2013-02-07 Thread Ralph Goers
I suspect you have a missing dependency such as Avro or Jackson. However, I would have expected a stack trace with a bit more information. Ralph On Feb 7, 2013, at 12:17 PM, Yogi Nerella wrote: Hi, I am trying to use FlumeNg Appender and running into the following exception.

Re: 2.0-Beta4

2013-02-07 Thread Ralph Goers
help Yogi On Thu, Feb 7, 2013 at 2:26 PM, Ralph Goers ralph.go...@dslextreme.com wrote: I suspect you have a missing dependency such as Avro or Jackson. However, I would have expected a stack trace with a bit more information. Ralph On Feb 7, 2013, at 12:17 PM, Yogi Nerella

Re: Beta 4, is slf4j bindings broken?

2013-02-13 Thread Ralph Goers
Are you including the slf4j-ext jar in addition to the slf4j-api jar? Ralph On Feb 13, 2013, at 2:57 PM, Yogi Nerella wrote: Hi, When I try to use SLF4J bindings with log4j2.0 implementations I run into the following exception? Exception in thread main java.lang.NoClassDefFoundError:

Re: how to set to RollingFileAppender interval to 5 minutes.

2013-02-14 Thread Ralph Goers
You should be able to set the pattern to include minutes and then specify the interval on the TriggeringPolicy. If you set it to 5 then it should roll every 5 minutes. If you specify modulate as true then it will occur on the 5, 10, 15, etc minute of the hour. Ralph On Feb 14, 2013, at 9:55

Re: Any thoughts on RollingFlumeAppender

2013-02-14 Thread Ralph Goers
What you are asking for is essentially the Flume embedded appender. However, since Flume has so many dependencies I could understand why you would want to do this. Would making RollingFileAppender not be final actually buy you anything? You would have to provide your own PluginFactory

Re: Can substitution in replace regexpression take the MDC context key name?

2013-02-15 Thread Ralph Goers
Where are you wanting to do this? In a pattern in the pattern layout you just use %X{app name} as you show below. In many places you can use ${mdc:name}. Ralph On Feb 15, 2013, at 12:02 PM, Yogi Nerella wrote: Hi, I want to replace some constant strings with the MDC.context() values?

Re: Beta 4, is slf4j bindings broken?

2013-02-15 Thread Ralph Goers
point me how to build this jar by myself, so that I do not need to wait for the next available build. Thanks Yogi On Wed, Feb 13, 2013 at 5:54 PM, Ralph Goers ralph.go...@dslextreme.comwrote: The SLF4J binding also supports the SLF4J extensions and so requires slf4j-ext-1.7.2.jar

Re: how to set to RollingFileAppender interval to 5 minutes.

2013-02-15 Thread Ralph Goers
at 10:39 AM, Ralph Goers ralph.go...@dslextreme.comwrote: You should be able to set the pattern to include minutes and then specify the interval on the TriggeringPolicy. If you set it to 5 then it should roll every 5 minutes. If you specify modulate as true then it will occur on the 5, 10, 15

Re: Any tools to convert log messages to log events

2013-02-22 Thread Ralph Goers
Scott, Yogi has been asking other questions about Log4j 2 so I'm not clear if his question applies to that or 1.x. Or does the VFSLogFilePatternReceiver work with Log4j 2? Ralph On Feb 22, 2013, at 3:32 PM, Scott Deboy wrote: If you want the events to end up in log4j (being processed by

Re: Any tools to convert log messages to log events

2013-02-22 Thread Ralph Goers
are they documented? Ralph On Feb 22, 2013, at 3:51 PM, Scott Deboy wrote: Log4j2 has no concept of receivers, correct? On Fri, Feb 22, 2013 at 3:39 PM, Ralph Goers ralph.go...@dslextreme.comwrote: Scott, Yogi has been asking other questions about Log4j 2 so I'm not clear if his question applies

Re: Any tools to convert log messages to log events

2013-02-22 Thread Ralph Goers
received events to the local log4j system, which are then picked up by locally defined appenders. This is how Chainsaw works - it programmatically registers its own appender to pull in events appended by the configured receivers. On Fri, Feb 22, 2013 at 4:37 PM, Ralph Goers ralph.go

Re: Configuration file location programmatically

2013-03-07 Thread Ralph Goers
In Log4j 2 it is the LoggerContext that is configured. You can cause the LoggerContext to pick up its configuration in one of a couple of ways: 1. Set the log4j.configurationFile system property before calling Log4j. This will allow you to have a default or single configuration. 2. Use one of

Re: Newbie questions around configuration

2013-03-14 Thread Ralph Goers
You have two root loggers. Only one of them is going to take effect. The other should have generated an error but it sounds like it didn't. That is a bug and needs to be fixed. It sounds like the second root logger is winning and so all messages except those marked as trace will go to the

Re: thread debug level

2013-03-14 Thread Ralph Goers
This is possible now. Please see http://logging.apache.org/log4j/2.x/manual/filters.html#ThreadContextMapFilter. If you add the user's loginid to the ThreadContextMap you can filter users at different logging levels. Ralph On Mar 14, 2013, at 3:03 AM, Tushar Kapila wrote: it would be nice

Re: Newbie questions around configuration

2013-03-14 Thread Ralph Goers
I have not implemented support for properties files in Log4j 2. It would be fairly easy to implement but I've never really liked the way they worked in Log4j 1.x so I just didn't do it. I prefer XML but at an ApacheCon a couple of years ago I was encouraged to support JSON and since it

Re: Flushing FileAppender explicitly

2013-03-23 Thread Ralph Goers
Sorry for not responding sooner. The best way to do this is to use Configurator to initialize and shutdown Log4j 2 in your application. This will close the file during shutdown. See

Re: Problems with log4j 2

2013-03-24 Thread Ralph Goers
Can you provide the list of jars you have on your classpath? Ralph On Mar 23, 2013, at 11:08 PM, wangke wrote: Hi all: I am trying to get this simple example working, I included all the jars in apache-log4j-2.0-beta4-bin import org.apache.logging.log4j.LogManager;import

Re: Problems with log4j 2

2013-03-24 Thread Ralph Goers
You cannot have both log4j-slf4j-impl and log4j-to-slf4j. The first routes all calls from the SLF4J API to the Log4j 2 API. The second routes all calls from the Log4j 2 API to SLF4J. This is creating the circularity. You should only include the jars you need based on what you want to do. For

Re: Three things I couldn't find on the Log4j 2 Site

2013-03-24 Thread Ralph Goers
First, while I've done a lot of the work up until this point Apache is a place where the community makes the decisions. 1) How stable is the API? We recently had requests to add at least one log(level, ) method to the API. That will probably be done. We have also had a request to

Re: Flushing FileAppender explicitly

2013-03-25 Thread Ralph Goers
Sorry, I actually thought this way would be simpler. In addition, cleanly shutting down is usually a good thing. :-) I'll look and see if there is a more direct way to force a flush. Ralph On Mar 25, 2013, at 9:41 AM, adischlesinger wrote: Thanks! I did not succeed however. I am using a

Re: Problems with FileoverAppender

2013-03-26 Thread Ralph Goers
I've been doing some work on the SocketAppender, which is the base for the SyslogAppender. The SocketAppender is not flushing the OutputStream on every send. From what I can tell this is causing the data to be buffered and the exception only gets thrown when the buffer gets full and actual I/O

Re: Problems with FileoverAppender

2013-03-27 Thread Ralph Goers
Unfortunately, the appender has no idea how much data is being buffered as the buffer is managed by the Socket. Ralph On Mar 27, 2013, at 4:11 AM, Daniele Menotti wrote: Thanks for your reply Ralph. In order to preserve the performance could be better to guarantee that when the

Re: Three things I couldn't find on the Log4j 2 Site

2013-03-28 Thread Ralph Goers
On Mar 28, 2013, at 7:53 AM, Gary Gregory wrote: On Sun, Mar 24, 2013 at 4:08 AM, Nick Williams nicho...@nicholaswilliams.net wrote: I've been a Log4j 1 user for years and I love it. I'm currently writing a book for Java EE 7 + Spring Framework 4 development and one of my chapters is on

Re: FQCN in log4j 2

2013-04-11 Thread Ralph Goers
Yes - that is exactly what the class is for. You can find couple examples of how to use it in the SLF4J adapter and the JCL bridge sub projects. Ralph On Apr 11, 2013, at 9:22 AM, Eduardo Macarron wrote: Hi again, I found an AbstractLoggerWrapper class that looks suitable for this.

Re: Issue with Tomcat auto-redeploy on Windows.

2013-04-17 Thread Ralph Goers
Not that I am aware of. If the web app is using the log4j 2 web module to initialize and destroy its context I would expect this to work. Ralph On Apr 17, 2013, at 1:28 PM, Fabien Sanglard wrote: It seems there is an issue with log4j 2 not closing the core JAR handle on Windows. It

Re: General config question for Log4J2

2013-04-23 Thread Ralph Goers
You cannot have two root loggers but you can have multiple appender-refs on them. Each appender-ref can have its own log level so I believe you get the same behavior that you are looking for. Ralph On Apr 23, 2013, at 12:37 PM, Peter DePasquale wrote: Is it possible to use two root loggers,

Re: General config question for Log4J2

2013-04-23 Thread Ralph Goers
want. The second discards events lower than what you want. Ralph On Apr 23, 2013, at 5:22 PM, Peter DePasquale wrote: Can you point me to an example in the documentation? I didn't see anything like that in there, that I recall... On Tue, Apr 23, 2013 at 6:28 PM, Ralph Goers ralph.go

Re: General config question for Log4J2

2013-04-23 Thread Ralph Goers
Sent from my iPhone On 2013/04/24, at 9:22, Peter DePasquale peter.depasqu...@gmail.com wrote: Can you point me to an example in the documentation? I didn't see anything like that in there, that I recall... On Tue, Apr 23, 2013 at 6:28 PM, Ralph Goers ralph.go...@dslextreme.comwrote

Re: General config question for Log4J2

2013-04-23 Thread Ralph Goers
PM, Remko Popma wrote: I see. I understood Peter's question differently. Let's hope one of our answers solves his problem! :-) Sent from my iPhone On 2013/04/24, at 9:46, Ralph Goers ralph.go...@dslextreme.com wrote: Your trace file will also contain info and above. From Peter's

Re: [ANNOUCMENT] Welcome Remko Popma

2013-04-24 Thread Ralph Goers
Welcome Remko! I am greatly looking forward to your continuing contributions. Ralph On Apr 24, 2013, at 12:49 AM, Christian Grobmeier grobme...@gmail.com wrote: Hi all, it is my pleasure to announce to the community that Remko Popma has joined our ranks. He made remarkable

[ANNOUNCEMENT] Apache Log4j 2.0-beta5 released

2013-04-25 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.0-beta5 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 of the improvements

Re: Two problems with SMTPAppender

2013-05-10 Thread Ralph Goers
Your understanding is correct. The intention is to include the last n log events in the email when an error occurs, regardless of their log level. This is often useful for debugging. I believe this behavior carried over from either log4j 1.x or logback - I'm not really sure since someone else

Re: [ANNOUNCEMENT] Welcome Nick Williams

2013-05-11 Thread Ralph Goers
Welcome, Nick. Keep up the good work! Ralph On May 10, 2013, at 9:53 PM, Christian Grobmeier wrote: Hi, it is my pleasure to announce to the community that Nick Williams has joined our ranks. He made remarkable contributions to log4j 2 and we all believe he is a valuable member of

[ANNOUNCEMENT] Apache Log4j 2.0-beta6 released

2013-05-12 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.0-beta6 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 of the improvements

Re: Convient way to specify Log4J2 configuration outside of webapp?

2013-05-15 Thread Ralph Goers
No. In that case see http://logging.apache.org/log4j/2.x/log4j-web/index.html and the Log4jContextListener. https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/samples/flume-remote/ has a sample web app that writes to Flume and uses the Log4jContextListener to locate its

Re: Programmatically setting log4j2 log level

2013-05-17 Thread Ralph Goers
Can you provide a sample application that demonstrates this? Ralph On May 16, 2013, at 9:44 PM, Eric Scheie wrote: I'm developing a web application and would like to be able to dynamically change log levels from within my application instead of editing the log4j2 configuration file. I'm

Re: Programmatically setting log4j2 log level

2013-05-17 Thread Ralph Goers
logger be inheriting the level from the Root Logger since an explicit level has not been set? Thanks, -Eric On Thu, May 16, 2013 at 11:49 PM, Ralph Goers ralph.go...@dslextreme.comwrote: Can you provide a sample application that demonstrates this? Ralph On May 16, 2013

Re: Programmatically setting log4j2 log level

2013-05-19 Thread Ralph Goers
. On May 17, 2013 10:40 PM, Ralph Goers ralph.go...@dslextreme.com wrote: No, the X Logger does not inherit its level from the root Logger. It inherits its level from the root LoggerConfig. See the picture at http://logging.apache.org/log4j/2.x/manual/architecture.html. The level you

Re: How do I add a prefix to log4j messages (at the object level)

2013-05-27 Thread Ralph Goers
You could use a custom MessageFactory. public class MyMessageFactory extends ParameterizedMessageFactory { private final String objId; public MyMessageFactory(Object obj) { this.objId = obj.toString(); } @Override public Message

Re: How do I add a prefix to log4j messages (at the object level)

2013-05-28 Thread Ralph Goers
Thanks. We need to add that example to a wiki page or add it to some examples on the web site. Ralph On May 28, 2013, at 8:08 AM, Lucie Boubée wrote: Thanks, I implements MessageFactory and it's works 2013/5/27 Ralph Goers ralph.go...@dslextreme.com You could use a custom

Re: spool file filled

2013-06-02 Thread Ralph Goers
You need to provide more information on what you are doing. I don't know what spool file you are referring to. Ralph On Jun 2, 2013, at 8:47 AM, Navindian wrote: Hi the spool file is getting filled very quickly. I have increased the size by 10 times, but still it is filling the file.

[ANNOUNCEMENT] Apache Log4j 2.0-beta7 released

2013-06-08 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.0-beta7 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 of the improvements

[ANNOUNCEMENT] Apache Log4j 2.0-beta8 released

2013-07-14 Thread Ralph Goers
The Apache Log4j 2 team is pleased to announce the Log4j 2.0-beta8 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 of the improvements

Re: Lookup support for JNDI resources?

2013-07-17 Thread Ralph Goers
You would need to create a JNDILookup plugin. This should be easy to do. I would suggest you create a Jira issue to request this. If you could supply the patch that would be great but if not it should be pretty easy to implement. Ralph On Jul 17, 2013, at 8:27 AM, Woonsan Ko wrote: Hi,

  1   2   3   4   5   6   7   8   9   10   >