Re: Set log level while running integration test

2015-07-31 Thread Jacob Kjome
Just create 2 log4j.properties files: one for unit tests and one for performance tests.  Place these files in different directories and add the appropriate directory to the classpath for each type of test run, respectively. Jake On Thu, 30 Jul 2015 00:45:46 +  "Liang, Hsuan Tzu" wrote:

Re: how to override log4j.properties bundled in jar

2015-01-08 Thread Jacob Kjome
Actually, that should work if memory serves me correctly.  Are you saying the one in the jar file still gets picked up?  One thing you might need to do is to define the path as a fully qualified URL, such as -Dlog4j.configuration=file:/tmp/log4j.properties ...or, for windows -Dlog4j

Re: log4j.properties gets loaded twice causing rollling to fail

2014-07-14 Thread Jacob Kjome
n Sun 13 Jul, 2014, at 12:24 pm, "Jacob Kjome" wrote: Because Log4j, by default, looks for config files in the default package. Furthermore, because of Tomcat's child-first classloading behavior, if you place log4j.properties in the default package of the webapp (WEB-INF/class

Re: log4j.properties gets loaded twice causing rollling to fail

2014-07-12 Thread Jacob Kjome
further why putting the application log4j.properties in WEB-INF/classes, as opposed to WEB-INF/classes/properties, would prevent the webapp classloader from seeing the tomcat's log4j.properties? Gerald On 11 Jul, 2014, at 11:27 pm, "Jacob Kjome" wrote: Why don't you place

Re: All log4j appenders defined in log4j.properties in play

2014-07-11 Thread Jacob Kjome
First, your understanding is incorrect.  You can attach appenders to any logger, not just the root.  Second, there must be some other stray log4j config file being loaded, instead of this one, that logs to a file appender pointing at the same file as the one in this log4j.properties. I sugge

Re: log4j.properties gets loaded twice causing rollling to fail

2014-07-11 Thread Jacob Kjome
Why don't you place your webapp's log4j.properties file in WEB-INF/classes instead of WEB-INF/classes/properties?  That way, the webapp classloader won't ever see the tomcat log4j.properties, thus no rolling file appender conflicts. Jake On Fri, 11 Jul 2014 11:16:41 +0800  guowei wrote: De

Re: beta9 to rc1

2014-03-22 Thread Jacob Kjome
Regarding the serialization exception, are you saving an object to the session that contains a reference to a non-static/non-transient Logger object?  If so, that's why. Jake On Sun, 23 Mar 2014 08:45:40 +0530  Mahesh Dilhan wrote: HI I managed to *fix *the *look-up issue*, just configuri

Re: Multiple appenders and verbose logging for specific classes for an appender

2013-10-02 Thread Jacob Kjome
n't seem to > work. > log4j.logger.classX=debug, A > > Is there a simple example similar to my requirements somewhere? > > Thanks > Fredrik > > > On Tue, Oct 1, 2013 at 6:50 PM, Jacob Kjome > > wrote: > > > On Tue, 1 Oct 2013 18:17:41 +0200 > >

Re: Multiple appenders and verbose logging for specific classes for an appender

2013-10-01 Thread Jacob Kjome
On Tue, 1 Oct 2013 18:17:41 +0200  fedinho wrote: Hi. A simple question I hope someone can help me with. This is using log4j 1.2.x I would like to log info level to one appender A and warn level to another appenderB. However, I would like to log debug messages from class X to appender A, and

Re: why can log4j2 not print on console in command window

2013-09-09 Thread Jacob Kjome
As I stated before, you need to place a period (".") in the manifest.mf Class-Path in order to load resources outside the current jar or jars referenced in the Class-Path.  For instance... Class-Path: . lib/antlr-2.7.6.jar lib/other.jar That period will place the current directory (the one c

Re: ?????? ??????why can log4j2 not print on console in command window

2013-09-08 Thread Jacob Kjome
Please post the contents of the manifest.mf file.  Unless you have a period in the "Class-Path" value, then the current directory won't get placed in the classpath using the -jar option.  Hence, your log4j2.xml won't get picked up. For instance.. Class-Path: . someJarDep.jar Jake On Mon,

Re: Need help: Steps in your INSTALL doc failing

2013-05-14 Thread Jacob Kjome
  NTEventLogAppender.dll Any ideas? Thx. Mary On Tue, May 14, 2013 at 8:36 AM, Jacob Kjome wrote: No, Mary is just running an example from the install documentation.  And since the code is calling BasicConfigurator.configure(), there is no need for a config file in the classpath (though it is

Re: Need help: Steps in your INSTALL doc failing

2013-05-14 Thread Jacob Kjome
No, Mary is just running an example from the install documentation.  And since the code is calling BasicConfigurator.configure(), there is no need for a config file in the classpath (though it is generally recommended to use a config file rather than configure via code). Mary, please provide

Re: Communcating An Own Properties-Object To log4j As Substtution For System-Properties

2012-11-16 Thread Jacob Kjome
what kind ever. I mean why should an application know about what appender type and name is used in log4 configuration? I am afraid the logger then is loosing a lot of configuration flexibility, does'nt it? Malte -Ursprüngliche Nachricht----- Von: Jacob Kjome [mailto:h...@visi.com] Ge

Re: Communcating An Own Properties-Object To log4j As Substtution For System-Properties

2012-11-16 Thread Jacob Kjome
le run-time. Since there was no special code needed for inventing own parameters, but producing setter-methods in the customized appender, I believe log4j binds the parameters by reflection. Malte -Ursprüngliche Nachricht- Von: Jacob Kjome [mailto:h...@visi.com] Gesendet: Freitag, 16. Nove

Re: Communcating An Own Properties-Object To log4j As Substtution For System-Properties

2012-11-16 Thread Jacob Kjome
Well, you can manually bind properties at configuration time by loading the config as a properties object, adding more properties, and then calling configure(Properties) [1].  It's not clear to me how this might be done with XML configuration, thought I vaguely recall it being talked about in

Re: each log message output twice

2012-11-08 Thread Jacob Kjome
The "x" logger inherits the root appender instances (unless you set "additivity" for "x" to "false").  But then you are adding new appender instances to the "x" logger, so you have 4 instances; 2 per/appender.  Therefore, you should expect each message to be written twice to each appender.

Re: all log4j level in jar application is treated as debug level

2012-11-07 Thread Jacob Kjome
This sort of confusion is almost always caused by some other configuration file being loaded rather than the one you expect.  I suggest setting -Dlog4j.debug=true on the command line (in this case, the command line starting the appserver), which will cause Log4j to provide information on how

Re: Log4j Extras ExpressionFilter issue

2012-10-05 Thread Jacob Kjome
ator, and the filter parsing could be failing silently. http://www.mail-archive.com/log4j-user@logging.apache.org/msg08828.html Scott On Fri, Oct 5, 2012 at 2:09 PM, Jacob Kjome wrote: Here's the relevant Log4j debug output (no error thrown upon parsing, as you can see)... log4j: Class name: [org.ap

Re: Log4j Extras ExpressionFilter issue

2012-10-05 Thread Jacob Kjome
appens. Scott On Fri, Oct 5, 2012 at 1:38 PM, Jacob Kjome wrote: When you added the URL to the "marker" field, did you add it with "&" or "&"? When setting it via MDC, I'd be setting it as "&".  But, in XML, it must be escaped using

Re: Log4j Extras ExpressionFilter issue

2012-10-05 Thread Jacob Kjome
prop.marker == ' https://somedomain/somepath/somepage.do?someparam=someval&anotherparam=anotherval ') Gave me all of the debug entries and two info level entries.. It could be something weird with trace...or something weird with parsing the & ??? but...this should work.. S

Re: Log4j Extras ExpressionFilter issue

2012-10-03 Thread Jacob Kjome
== 'https://somedomain/somepath/somepage.do?someparam=someval&anotherparam=anotherval' )"/>                                     On Tue, 2 Oct 2012 15:53:57 -0700  Scott Deboy wrote: Try PROP.url == 'blah' MDC entries are really just set

Log4j Extras ExpressionFilter issue

2012-10-02 Thread Jacob Kjome
I'm trying to use the ExpressionFilter [1] from Log4j Extras to limit logging for a particular appender to those cases where MDC contains a "url" entry that equals some specific value.  But I get an error from Log4j saying "Invalid EQUALS rule - MDC.url is not a supported field" (see below for

Re: Pushing STDOUT to File...

2012-10-01 Thread Jacob Kjome
You don't appear to reference your "DRFA" appender in any logger.  You specifically reference the "console" appender in the rootLogger.  Why do you think that your logging should go to file when you specifically have it configure to go to Console? Jake On Mon, 1 Oct 2012 18:17:35 +0100  Lew

Re: Logging with specialized logger for webapplication

2012-06-25 Thread Jacob Kjome
I think some of your config is missing.  It must have gotten messed up by your email client or something?  Maybe you can try to attach (can't remember if the list allows attachments) or post a link to the config. Jake On Mon, 25 Jun 2012 05:05:38 -0700 (PDT)  garfield168 wrote: Hello, W

Re: User-based logger level

2012-06-11 Thread Jacob Kjome
It's possible that Log4j2 supports this out of the box, but for Log4j1, the obvious way is to call logger.log() methods that accept an explicit Level/Priority [1].  Set a ThreadLocal with the Level to use and pass that Level to log() method. [1] http://logging.apache.org/log4j/1.2/apidocs/o

Re: class specific logging level

2012-06-08 Thread Jacob Kjome
First, you are not setting the level of the appender, but that of the logger which can reference any given appender, including your named "Log1" appender.  So, if you want ERROR level for all classes, then set the "root" logger level to ERROR.  After that, you make a decision of which append

Re: class specific logging level

2012-06-08 Thread Jacob Kjome
ut it isnt happening. Am not getting any DEBUG logs in "log1.log" whereas if I set the level in appender "Log1" to DEBUG, I do get the DEBUG logs of Myclass in log1.log. I am sorry if am still making some mistake here. Please correct me where am I wrong. Thanks for such quick r

Re: class specific logging level

2012-06-08 Thread Jacob Kjome
level of all classes and DEBUG of only few important classes. I am new to log4j so maybe what i am sayin is wrong. Jacob Kjome wrote: If you name your loggers by class name, then sure.  This is standard logging configuration, not some extra special workaround.                    

Re: class specific logging level

2012-06-07 Thread Jacob Kjome
If you name your loggers by class name, then sure.  This is standard logging configuration, not some extra special workaround.                         Jake On Thu, 7 Jun 2012 01:51:07 -0700 (PDT)  aggarwal wrote: Hi, Is it possible to set logging level for few selected cla

Re: SMTPAppender & MDC

2012-06-07 Thread Jacob Kjome
Alternatively, if you want to stick with Log4j, try. http://openutils.sourceforge.net/openutils-log4j/smtpappender.html Jake On Thu, 07 Jun 2012 11:40:31 +0200  ceki wrote: Hi Zbynek, Have you looked at logback? Its SMTPAppender [1] supports dynamically setting the destination, thus a

Re: slf4j, log4j and PropertyConfigurator.configure

2012-06-06 Thread Jacob Kjome
Do you have multiple copies of log4j.jar in different classloaders?  For instance, let's say you run under Tomcat where webapps use child-first classloading.  You place log4j and slf4j in WEB-INF/lib and configure Log4j for this classloader.  But then you also have log4j/slf4j in a parent cla

Re: unable to set properties

2012-05-07 Thread Jacob Kjome
ase tell me what are runtime dependencies for the log4j-extras? I see compile time dependency as log4j-1.2.16 but could not find anything for compile time dependency. Will log4j-1.2.15 work for runtime. Thanks On Mon, May 7, 2012 at 8:36 PM, Jacob Kjome wrote: Do you have log4j-extras.jar [1] in

Re: unable to set properties

2012-05-07 Thread Jacob Kjome
Do you have log4j-extras.jar [1] in the classpath along with log4j.jar?  If not, that's the problem. [1] http://logging.apache.org/log4j/companions/extras/ Jake On Mon, 7 May 2012 15:03:08 +0530  aanjaneya shukla wrote: Hi, I am using the below mentioned log4j.properties file in tomcat 6.0

Re: RootCategory and RootLogger

2012-05-01 Thread Jacob Kjome
Excellent idea for a project! Category/Priority are deprecated in favor of Logger/Level.  I would suggest that any converter you create have an option to convert deprecated names to non-deprecated names. Jake On Tue, 1 May 2012 15:36:37 +0200  "janinko.g" wrote: Hello, we are making conve

Re: Log4J doesn't work at all

2012-04-11 Thread Jacob Kjome
Selenium depends upon SLF4J.  You may recall that I mentioned SLF4J in a previous email.  In appears Selenium includes it's own SLF4J binding.  It seems rather silly to me that they would include this as part of their main library rather than as a separate, optional, jar. I suggest you conta

Re: Log4J doesn't work at all

2012-04-10 Thread Jacob Kjome
In your other email you say... Running command line. From within NetBeans. No fancy stuff. Never discount the complexity of an IDE and how it forks JVMs and/or performs idiosyncratic classloading. In any case, your test below is invalid in this context.  You claimed, in an earlier respons

Re: Log4J doesn't work at all

2012-04-10 Thread Jacob Kjome
On Tue, 10 Apr 2012 19:23:18 +0200  tomm wrote:    System.setProperty("log4j.**logger.org.apache.http.client"**, "DEBUG"); But HttpClient's instructions say to do (again, read the instructions more closely)...   System.setProperty("org.**apache.commons.logging.** simplelog.log.org.apa

Re: Log4J doesn't work at all

2012-04-10 Thread Jacob Kjome
On Tue, 10 Apr 2012 18:43:21 +0200  tomm wrote: There is no commons-logging-api.jar in my classpath anywhere. There is commons-logging-1.1.1.jar (there are 2 of them actually). There is only one log4j in my classpath and it is log4j-1.2.16.jar Are the jars binary identical?  That is, are t

Re: Log4J doesn't work at all

2012-04-10 Thread Jacob Kjome
[1] http://slf4j.org/legacy.html#jcl-over-slf4j Jake On Tue, 10 Apr 2012 16:08:07 +0200  tomm wrote: On 10 April 2012 15:34, Jacob Kjome wrote: That system property stuff only applies to commons-logging, not Log4j. Look more closely at the instructions [1]. BTW, are you using common

Re: Log4J doesn't work at all

2012-04-10 Thread Jacob Kjome
That system property stuff only applies to commons-logging, not Log4j.  Look more closely at the instructions [1]. BTW, are you using commons-logging-api.jar?  If so, that's the problem.  You need commons-logging.jar.  See the commons-logging release notes [2]. [1] http://hc.apache.org/http

Re: LogManager / LoggerRepository

2012-02-17 Thread Jacob Kjome
It's not clear what problem you are trying to solve?  When you call Logger.getLogger("blah"), if "blah" Logger does not yet exist, it is created.  If it does exist it is returned.  Loggers are stored in a LoggerRepository.  How many logger repositories there are depends upon logger repository

Re: Programmatically create a ConsoleAppender

2012-02-13 Thread Jacob Kjome
it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the Gottex Group of Companies for any loss or damage arising in any way from its use. -Original Message- From: Jacob Kjome [mailto:h...@visi.com]

Re: Programmatically create a ConsoleAppender

2012-02-13 Thread Jacob Kjome
Level is the new Priority, just as Logger is the new Category.  Try Level.DEBUG. Jake On Mon, 13 Feb 2012 09:31:03 +  Edmondo Porcu wrote: Dear all, I have a test-case where I want to add extra logging compared to my normal logging settings. I have therefore create manually an appender

Re: SMTPAppender Problems

2012-01-29 Thread Jacob Kjome
I suggest you run with log4j debugging, which you can set in the config file or using -Dlog4j.debug=true on the command line. Also, it seems odd to define two entries with the same name "org.tabbysplace.sso".  I'm not sure what Log4j will do with this?  I can see the appenders being additiv

Re: log4j in two different project

2012-01-12 Thread Jacob Kjome
lly deploy this in WEB-INF/lib.  I'll leave it at that. Jake Thanks, Anjib On 1/9/2012 4:37 PM, Jacob Kjome wrote: Are you log4j.properties files for each project identical?  My guess is that they are different and the config file for you webapp doesn't provide the configura

Re: log4j in two different project

2012-01-09 Thread Jacob Kjome
Are you log4j.properties files for each project identical?  My guess is that they are different and the config file for you webapp doesn't provide the configuration you require for your DAO. BTW, is the DAO project deployed in WEB-INF/lib?  That is, is it part of the same classloader as the

Re: Log4J DailyrollingFileAppender Issue

2012-01-09 Thread Jacob Kjome
Are both applications run within the same JVM, or do you start up a separate JVM for the second application?  If the latter, then no, it's not supported.  You should point to a separate file location.  This has more to do with the JVM than Log4j, though.  That said, I think it's possible to do

Re: SMTPAppender , server instance

2011-11-16 Thread Jacob Kjome
You really should look at this alternate SMTP Appender.  I think it provides everything you need in a clean way http://www.openmindlab.com/lab/tools/openutilslog4j/smtp.html Jake On Wed, 16 Nov 2011 16:38:31 +0100  Zbynek Vavros wrote: Hi, you can use profiling for deployment - Mave

Re: org.apache.log4j.MDC vs. org.slf4j.MDC

2011-11-02 Thread Jacob Kjome
Hi Steve, Your question really should be directed to the SLF4J mailing list [1], as Log4j already provides what you need.  Your question deals with "why doesn't SLF4J provide what Log4j provides", which the Log4j team cannot authoritatively answer. [1] http://slf4j.org/mailing-lists.html

Re: Log4j sample example with EAR application

2011-10-17 Thread Jacob Kjome
IDE. Could you please send me any sample EAR application with log4j? Regards, Baji Shaik Jacob Kjome wrote: What server?  If Weblogic, try placing log4j.jar in the EAR's APP-INF/lib and the config in APP-INF/classes.  You won't need to place log4j in each webapp. Jake On 9/30/2011

Re: Log4j and Tomcat with multiple instances

2011-10-16 Thread Jacob Kjome
(redirected to the log4j-user list to make clear that the suggested solution works) That worked like a charm Jacob, thank you very much! /Peter On Thu, Oct 13, 2011 at 5:55 PM, Jacob Kjome mailto:h...@visi.com>> wrote: Here's what I do, which is a bit different from

Re: Log4j and Tomcat with multiple instances

2011-10-13 Thread Jacob Kjome
Here's what I do, which is a bit different from the Tomcat instructions.  I pretty much ignore #5 in their instructions 1.  Modify $CATALINA_BASE/conf/catalina.properties.  Change the single line... common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar ...to... common.loader=${c

Re: Log4j sample example with EAR application

2011-10-06 Thread Jacob Kjome
What server? If Weblogic, try placing log4j.jar in the EAR's APP-INF/lib and the config in APP-INF/classes. You won't need to place log4j in each webapp. Jake On 9/30/2011 8:12 AM, shaikbaji.forums wrote: > > Hi, > > I have designed a EAR project, It contains few EJB projects and one WEB

Re: Log4J not generating DEBUG messages

2011-09-15 Thread Jacob Kjome
kage is something like ve.com... That's whats inside package and my class is inside that package. Regards, Néstor Boscán On Wed, Sep 14, 2011 at 5:36 PM, Jacob Kjome wrote: "package" is an odd logger name.  How do you name your logger(s)?  You stated the following in y

Re: Log4J not generating DEBUG messages

2011-09-14 Thread Jacob Kjome
"package" is an odd logger name.  How do you name your logger(s)?  You stated the following in your original message: "...so that the classes in my package...".  What package?  A package named "package"?  Name the logger after the actual package name, such as "com.mycompany", rather than the l

Re: Changing Level of Logging during runtime

2011-09-04 Thread Jacob Kjome
There used to be a nice open source, Struts-based, Log4j configuration app out there, but it seems to have disappeared. There's a simple one in the Log4j-sandbox you can try... http://svn.apache.org/repos/asf/logging/sandbox/log4j/log4j_sandbox/tags/LOG4J_SANDBOX_ALPHA3/src/java/org/apache/log4j

Re: Log messages in multithreaded applications

2011-09-04 Thread Jacob Kjome
See PatternLayout javadoc [1]. In any case, I think getLogger(Class) just creates confusion. It was added as a convenience because of the way most people name their loggers, using the package/class hierarchy. But really a logger name is just a string and getLogger(String) would have been suffi

Re: log4j is not printing in specified path

2011-08-01 Thread Jacob Kjome
Run the app with -Dlog4j.debug=true This will make Log4j print out how it is configuring itself.  Often times it turns out that it's picking up some other config file than the one you assume it should be picking up. Jake On Mon, 1 Aug 2011 13:16:28 -0700 (PDT)  Sivaks wrote: Hi, I am tr

Re: AW: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-27 Thread Jacob Kjome
But in this case we're viewing a previously/currently written log4j file, hence the parsing. If you use a socket appender you can have Chainsaw capture the actual message events, just as you suggest. However, that may not be possible, nor even desirable, in many cases. I'm sure Scott Deboy can t

Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-22 Thread Jacob Kjome
The file isn't going to be loaded, nor written to, using an invalid URL with backslashes in it.  Use all forward slashes.  You have... "file:///C:\MyDocs\logs\mylog.log" It should be "file:///C:/MyDocs/logs/mylog.log" Or, simply... "file:/C:/MyDocs/logs/mylog.log" Jake On Thu, 21 Ju

Re: How do I hook in before log4j starts?

2011-07-19 Thread Jacob Kjome
Of course the quick fix is to manually set the "log4j.defaultInitOverride" property in code prior to calling LogManager.setRepositorySelector(rs,guard) using... System.setProperty("log4j.defaultInitOverride", "true"); That way, you don't have to depend on a user setting it. Jake On Tue, 19

Re: append user details with exception stacktrace

2011-07-14 Thread Jacob Kjome
can configure log4j to append additional information along with the stack trace , this additional information I mean user details from threadlocal. does this makes sense ? Jacob Kjome wrote: Can you restate the question?  It's not clear to me what you are trying to do, which is likely wh

Re: append user details with exception stacktrace

2011-07-14 Thread Jacob Kjome
Can you restate the question?  It's not clear to me what you are trying to do, which is likely why you haven't received an answer. Jake On Thu, 14 Jul 2011 07:47:45 -0700 (PDT)  fachhoch wrote: any help please ?  I want to modify the message which log4j is going to log , please help me

Re: configuring individually loggingf for every war application in an ear project

2011-06-21 Thread Jacob Kjome
If the webapps are configured to use child-first, or parent-last, classloading and log4j.jar is in WEB-INF/lib and log4j.xml is in WEB-INF/classes (or you specify the config path yourself using the Spring configuration utility), then logging should be separated. Shared libraries located outs

Re: Getting "Could not find root logger information" but I don't see why

2011-05-26 Thread Jacob Kjome
Due to some other constraints, I appear to be forced to have my log4j.jar at both the EAR and WAR classpath level.  In my WebLogic config, I'm doing everything I can to make it "prefer" the jars in the webapp. If you are using Weblogic 9.2+, then you may be able to use a FilteringClassLoa

Re: using of system properties in subject of SMTPAppender

2011-05-26 Thread Jacob Kjome
You might be interested in the "it.openutils.log4j.AlternateSMTPAppender" [1].  It allows for dynamic subjects and more.  Note that I am not affiliated with this project.  I just found it to be useful. [1] http://www.openmindlab.com/lab/tools/openutilslog4j/smtp.html Jake On Mon, 23 May

Re: Relative path of file appender

2011-05-26 Thread Jacob Kjome
Yes.  It will be relative to the directory from which the JVM started from. Jake On Thu, 26 May 2011 17:32:00 +0100  Jiafan Zhou wrote: The following log4j.properties uses a relative path for redirected file. Is it valid? log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appende

Re: Getting "Could not find root logger information" but I don't see why

2011-05-26 Thread Jacob Kjome
Is that a literal path? "...\my.ear\my.war\WEB-INF/log4j.xml" First, it's invalid since it has 3 periods, rather than 1 or 2.  Second, your slashes are inconsistent.  If you want to be agnostic to the OS, just always use forward slashes ("/"), which will work under both Unix and Windows in

Re: Why There isn't a Log File?

2011-04-01 Thread Jacob Kjome
You can use an XML config file just fine under Tomcat (with caveats... see below). I see two issues with your current XML config, though 1. The doctype should be... 2. The path in... ...should be either... ...or... I mentioned a caveat above about using XML config files in To

Re: log4j on WebSphere Application Server

2011-04-01 Thread Jacob Kjome
You can reference Java system properties using the syntaxt ${somePropertyName}, e.g., log4j.appender.A1.File=${log.dir}/stdout.log You can set Java system properties on the command line using... java -Dlog.dir=/path/to/log/directory Jake On 4/1/2011 1:10 PM, nulll wrote: > > Hi, >

Re: Log4j debug for one method in application

2011-03-28 Thread Jacob Kjome
You could set it to debug for a specific class logger without issue, no? Wouldn't you be using that same logger for all methods in the class anyway? Otherwise, create multiple logger named after the class and method and enable debug for the one you care about. Jake On 3/28/2011 1:46 PM, log4j

Re: Separating some classes' messages from

2011-02-24 Thread Jacob Kjome
-Dlog4j.defaultInitOverride=true -Dlog4j.configuration=file:/url/path/to/log4j.xml See more at... http://logging.apache.org/log4j/1.2/manual.html#defaultInit Jake On Thu, 24 Feb 2011 12:14:18 -0500  "Mikhail T." wrote: On 24.02.2011 10:49, Jacob Kjome wrote: Seems to me that Log

Re: xml config

2011-02-24 Thread Jacob Kjome
"I place the xml file in my dist folder but it just does not work." Is your "dist" folder in the running application's classpath?  If not, then you can't expect it to possibly get picked up. 1.  Log4j looks for config files in the default package.  For instance, in a webapp, this might be "W

Re: Separating some classes' messages from

2011-02-24 Thread Jacob Kjome
ote: On 23.02.2011 18:18, Jacob Kjome wrote: I tried that before -- it did not work... Here is the current actual config (full file is attached): ... But, for some reason, when the class org.serviio.console.ServiioConsole tries to make a log entr

Re: Separating some classes' messages from

2011-02-23 Thread Jacob Kjome
    Jake On Wed, 23 Feb 2011 17:34:26 -0500  "Mikhail T." wrote: Hello! I'm trying to create a log4j.xml file, that would send all messages from certain special classes into one location and everything else into another: Unfortun

Re: Setting properties for log4j.xml configuration file

2011-02-22 Thread Jacob Kjome
in XML configuration files to set system properties.  If the property was already set externally, then you could use the same type of expressions as in the example. On Feb 21, 2011, at 8:05 PM, Jacob Kjome wrote: Curt, Maybe I'm missing something, but how does using XML entity refs

Re: Setting properties for log4j.xml configuration file

2011-02-21 Thread Jacob Kjome
Curt, Maybe I'm missing something, but how does using XML entity refs do anything for referencing Java system properties? The simple answer is that Log4j XML config files support exactly the same syntax as properties files, e.g., I don't recall whether/where it's specifically docu

Re: FileAppender problem

2011-02-15 Thread Jacob Kjome
I suggest using a ServletContextLister and calling LogManager.shutdown() when your webapp is stopped. http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/LogManager.html#shutdown%28%29 http://stackoverflow.com/questions/839255/how-do-i-properly-log4j-closing-all-appenders-and-therefore

Re: Get the following error: NoClassDefFoundError: org.apache.log4j.Logger

2011-02-02 Thread Jacob Kjome
I presume you are running using something like?... java -jar myapp.jar Correct?  Note that if you try to add "-classpath" as a command line switch while using the "-jar" command line switch, it will be ignored.  In this case, you'll have to update your MANIFEST.MF file to include the Log4j li

Re: log4j to log to different files for each JVM instance

2010-12-30 Thread Jacob Kjome
Use placeholders in the config file and set system properties on the command line starting the JVM process. Jake On 12/29/2010 11:19 PM, lalpop kumar wrote: > how can I configure log4j to log to different files for each JVM instance in > the same host? > > ---

Re: set the placeholder in the log4j.properties file

2010-12-29 Thread Jacob Kjome
Log4j will attempt to auto-configure itself by looking for "log4j.xml" and then "log4j.properties" in the root of the claspath upon the first call to getLogger(). And yes, this may very well be before your init servlet runs. Note that the new configuration (done manually in the init servlet) wi

Re: Error using logging file

2010-12-16 Thread Jacob Kjome
Case-sensitivity: "console" is not the same as "Console". Jake On 12/16/2010 9:50 AM, Anjib Mulepati wrote: > I have Logging.properties file as: > > # Log4j configuration file. > log4j.rootCategory=DEBUG, Console, File > > # > # Console Appender > # > > log4j.appender.console=org.apache.l

Re: performance problem in multithread environment

2010-12-13 Thread Jacob Kjome
You will get better performance by not logging at all, no question.  However, there are tuning possibilities.  I see you mention "logger.info()".  In production, I generally only have "warn()" and above for the vast majority of loggers.  In fact, I configure the root logger up with the "WARN" le

Re: Log4j with multiple files converting to xml

2010-12-08 Thread Jacob Kjome
is there a way I can have 4 separate xml files with a unique logger and appender for each? --Refr inn gra "Wars are to be won with swords and spears, not with rice and salt." -- Uesugi Kenshin ________ From: Jacob Kjome To: Log4J Users List S

Re: Log4j with multiple files converting to xml

2010-12-08 Thread Jacob Kjome
I suggest that you take a crack at the configuration yourself.  If you still have questions, post it and we can help you tweak it. Jake On Wed, 8 Dec 2010 08:16:44 -0800 (PST) Refr Bruhl wrote: Greetings I tried searching for this on the mail archives link, the link seems to be changed.

Re: Extra RollingFileAppender with NLOG4j

2010-11-03 Thread Jacob Kjome
NLog4j is not an Apache Logging project.  It's a fork of Log4j hosted outside of Apache Logging.  Please try with an official Log4j version and respond back if you run into issues. Jake On Wed, 3 Nov 2010 11:55:29 -0400 wrote: I'm trying to get the RollingFileAppender from the extra log4j c

Re: Extending Logger

2010-11-02 Thread Jacob Kjome
I would tend to have a minimal log4j.xml containing basic configuration for the root logger, which I usually set to "WARN" to avoid being bombarded with annoying messages from libraries I don't care about.  However, there is no necessity to have a log4j.xml (or log4j.properties).  Log4j can be

Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-18 Thread Jacob Kjome
Depends how many "individual loggers" you are concerned with.  If there are, say, 3 named loggers, then just create 3 appenders; one for each logger.  However, if the number of logger names cannot be known at build time, then you will probably need a custom appender that you assign to some b

Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-15 Thread Jacob Kjome
If you have a limited set of loggers you are concerned with, just create a separate appender for each file you want created. So, if you have 5 loggers you care about, just create 5 appenders; each with its own file. Then associate the appropriate appender with the appropriate logger. In that ca

Re: RollingFileAppender + TimeBasedRollingPolicy

2010-10-14 Thread Jacob Kjome
Not that I can see. I think a FixedWindowRollingPolicy + SizeBasedTriggeringPolicy would do what you need. Of course, it won't roll based on time, but on size. Basically, you'd get a maximum backup of 12 (or less depending on what you configure) archived log files, which is hardly different tha

Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-14 Thread Jacob Kjome
I think for what you want (separate file/logger), you'll need to write a custom appender unless Bender Heri's suggestion suffices for you. Jake On 10/14/2010 3:30 AM, Mohan.Radhakrishnan wrote: > > Hope to revive this thread. Is there any way to use the feature I have > described. > > 1. Use th

Re: locating my log4j.properties file

2010-10-10 Thread Jacob Kjome
On 10/8/2010 3:37 PM, Don Raikes wrote: > Hello again, > > Ok so I solved some of my issues, but now I have others. > > In my log4j.properties file, I have configured 3 appenders. > A1console apppender > A2file appender to my errors.log file > A3file appender to my fulltrace log fil

Re: locating my log4j.properties file

2010-10-08 Thread Jacob Kjome
It's great that you got it working, but it doesn't appear you fully understand why... configure(String) [1] takes a java.io.File path. Given that you have provided a relative path, rather than a fully qualified one, location of the file is going to be relative to the directory from which you st

Re: How to use a second log4j.properties file for a special java program?

2010-08-30 Thread Jacob Kjome
On Sun, 29 Aug 2010 02:40:43 -0700 (PDT) BenXS wrote: Jacob Kjome wrote: 1.  If you deploy your app as a WAR file, then you can utilize child-first classloading.  As long as you include log4j.jar in WEB-INF/lib and log4j.properties (or log4j.xml) in WEB-INF/classes, then you will end up

Re: How to use a second log4j.properties file for a special java program?

2010-08-26 Thread Jacob Kjome
2 ways (both assuming you don't want to blow away the configuration for the server, but still use custom configuration for your application) 1.  If you deploy your app as a WAR file, then you can utilize child-first classloading.  As long as you include log4j.jar in WEB-INF/lib and log4j.prope

Re: configuring email appending for WARN and above

2010-08-16 Thread Jacob Kjome
This is documented in the SMTPAppender Javadoc [1]. log4j.appender.email.EvaluatorClass=com.mypackage.MyCustomTriggeringEventEvaluator ...where the latter class implements TriggeringEventEvaluator [2]. [1] http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/net/SMTPAppender.html [2]

Re: catalina.out flooded

2010-07-28 Thread Jacob Kjome
Well, you have some specific loggers set to INFO and DEBUG. Which loggers are causing the excessive output? I suspect the following definitions... log4j.logger.org.apache=info,ApacheLogs log4j.logger.org.apache.axis=debug,ApacheLogs If you really want all the apache libraries logging at the inf

Re: Log4j configuration

2010-07-28 Thread Jacob Kjome
be cumulative (at least I hope so).  Hopefully someone else can shed light on this possibility. would the call to LogManager.shutdown()and then DOMConfigurator.configure(initUrl) work. I've never tested it.  You should try it and report results. Jake Thanks in advance, Mohammed

Re: Log4j configuration

2010-07-28 Thread Jacob Kjome
Log4j configuration is cumulative.  One call to configure() does not override another.  Instead, the configurations are combined.  Each time you configure() on a config file that defines an appender, a new one will be added rather than blow away the old one.  Therefore you get duplicate logging

  1   2   3   4   5   6   7   8   9   >