Re: xml config
And if you add: -Dlog4j.debug=true to your vm params, you might have an output which helps you to identify your problem too Cheers Christian 2011/2/24 Douglas E Wegscheid : > and Jacob's other posting is also helpful: > > I quote: > > -Dlog4j.defaultInitOverride=true > -Dlog4j.configuration=file:/url/path/to/log4j.xml > > See more at... > http://logging.apache.org/log4j/1.2/manual.html#defaultInit > > ■ DOUGLAS E. WEGSCHEID // LEAD ENGINEER > (269) 923-5278 // douglas_e_wegsch...@whirlpool.com > "A wrong note played hesitatingly is a wrong note. A wrong note played > with conviction is interpretation." > > > > "Jacob Kjome" > 02/24/2011 12:06 PM > Please respond to > "Log4J Users List" > > > To > "Log4J Users List" > cc > > Subject > Re: xml config > > > > > > > > "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 "WEB-INF/classes". Or, it could be the root > directory > of a jar file. As long as it isn't in a named package like > "com.mycompany", > then you are golden. If you place the directory "/path/to/my/app" in the > classpath, then you would place your config file in the directory > "/path/to/my/app". > > 2. Log4j look for 2 different types of config files: XML files and > Properties > files. Because there are 2 possibilities, it has to prefer one over the > other. That is, it looks for one type and, if it doesn't find it, then > looks > for the other. Log4j prefers XML files over Properties files. That is, > if > log4j.xml is found, it doesn't bother looking for log4j.properties. > However, > if log4j.xml is not found, then it looks for log4j.properties. If you > have > both in the classpath, only log4j.xml will be used. In order to use > log4j.properties, ensure that log4j.xml is NOT in the classpath. > > 3. Just to emphasize the points in #1, your config file HAS to be in a > directory or jar file that is in the running application's classpath. If > it > is not, then it won't be found by Log4j. And if it is not in the default > package, it also won't be found. > > > Jake > > > On Thu, 24 Feb 2011 11:38:38 -0500 > Bobby Richards wrote: >> I guess I just do not understand log4j very well. I have spent the >> past two days searching and reading the mailing list but just cannot >> come up with an answer. >> >> I am using Netbeans for development and I cannot understand where to >> put my log4j.xml file, nor can I seem to figure out the concept. >> >> I have created the simplest project, I have tried the Properties >> loader but from what I have read it seems that log4j looks for the >> log4j.xml file: >> >> public class Main { >> static Logger logger = Logger.getLogger(Main.class); >> static Properties properties = new Properties(); >> static FileInputStream fis; >> /** >> * @param args the command line arguments >> */ >> public static void main(String[] args) { >> >> logger.info("info"); >> logger.debug("debug"); >> logger.warn("warn"); >> } >> } >> >> I added log4j.xml into the src folder: >> >> >> >> http://jakarta.apache.org/log4j/";> >> >> >> value="%d{ABSOLUTE} >>%5p >> %c{1}:%L - %m%n"/> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> I can only seem to get this to act properly when I "clean and build". >> Which makes no sense to me, the whole point of a config file is to >> change before run, but I am only getting the desired result if the >> code is essentially burned in. >> >>Further more, when I try to distribute my jar I place the xml file in >> my dist folder but it just does not work. >> >> At this point I am just beyond frustration, any help would be >> appreciated. I realize that this is the most basic of problems and I >> apologize. >> >> - >> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org >>For additional commands, e-mail: log4j-user-h...@logging.apache.org >> >> > > > - > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org > For additional commands, e-mail: log4j-user-h...@logging.apache.org > > > > -- http://www.grobmeier.de - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: xml config
and Jacob's other posting is also helpful: I quote: -Dlog4j.defaultInitOverride=true -Dlog4j.configuration=file:/url/path/to/log4j.xml See more at... http://logging.apache.org/log4j/1.2/manual.html#defaultInit ■ DOUGLAS E. WEGSCHEID // LEAD ENGINEER (269) 923-5278 // douglas_e_wegsch...@whirlpool.com "A wrong note played hesitatingly is a wrong note. A wrong note played with conviction is interpretation." "Jacob Kjome" 02/24/2011 12:06 PM Please respond to "Log4J Users List" To "Log4J Users List" cc Subject Re: xml config "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 "WEB-INF/classes". Or, it could be the root directory of a jar file. As long as it isn't in a named package like "com.mycompany", then you are golden. If you place the directory "/path/to/my/app" in the classpath, then you would place your config file in the directory "/path/to/my/app". 2. Log4j look for 2 different types of config files: XML files and Properties files. Because there are 2 possibilities, it has to prefer one over the other. That is, it looks for one type and, if it doesn't find it, then looks for the other. Log4j prefers XML files over Properties files. That is, if log4j.xml is found, it doesn't bother looking for log4j.properties. However, if log4j.xml is not found, then it looks for log4j.properties. If you have both in the classpath, only log4j.xml will be used. In order to use log4j.properties, ensure that log4j.xml is NOT in the classpath. 3. Just to emphasize the points in #1, your config file HAS to be in a directory or jar file that is in the running application's classpath. If it is not, then it won't be found by Log4j. And if it is not in the default package, it also won't be found. Jake On Thu, 24 Feb 2011 11:38:38 -0500 Bobby Richards wrote: > I guess I just do not understand log4j very well. I have spent the > past two days searching and reading the mailing list but just cannot > come up with an answer. > > I am using Netbeans for development and I cannot understand where to > put my log4j.xml file, nor can I seem to figure out the concept. > > I have created the simplest project, I have tried the Properties > loader but from what I have read it seems that log4j looks for the > log4j.xml file: > > public class Main { > static Logger logger = Logger.getLogger(Main.class); > static Properties properties = new Properties(); > static FileInputStream fis; > /** >* @param args the command line arguments >*/ > public static void main(String[] args) { > > logger.info("info"); > logger.debug("debug"); > logger.warn("warn"); > } > } > > I added log4j.xml into the src folder: > > > > http://jakarta.apache.org/log4j/";> > > > > > > > > > > > > > > > > > > > I can only seem to get this to act properly when I "clean and build". > Which makes no sense to me, the whole point of a config file is to > change before run, but I am only getting the desired result if the > code is essentially burned in. > >Further more, when I try to distribute my jar I place the xml file in > my dist folder but it just does not work. > > At this point I am just beyond frustration, any help would be > appreciated. I realize that this is the most basic of problems and I > apologize. > > - > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org >For additional commands, e-mail: log4j-user-h...@logging.apache.org > > - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: xml config
"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 "WEB-INF/classes". Or, it could be the root directory of a jar file. As long as it isn't in a named package like "com.mycompany", then you are golden. If you place the directory "/path/to/my/app" in the classpath, then you would place your config file in the directory "/path/to/my/app". 2. Log4j look for 2 different types of config files: XML files and Properties files. Because there are 2 possibilities, it has to prefer one over the other. That is, it looks for one type and, if it doesn't find it, then looks for the other. Log4j prefers XML files over Properties files. That is, if log4j.xml is found, it doesn't bother looking for log4j.properties. However, if log4j.xml is not found, then it looks for log4j.properties. If you have both in the classpath, only log4j.xml will be used. In order to use log4j.properties, ensure that log4j.xml is NOT in the classpath. 3. Just to emphasize the points in #1, your config file HAS to be in a directory or jar file that is in the running application's classpath. If it is not, then it won't be found by Log4j. And if it is not in the default package, it also won't be found. Jake On Thu, 24 Feb 2011 11:38:38 -0500 Bobby Richards wrote: I guess I just do not understand log4j very well. I have spent the past two days searching and reading the mailing list but just cannot come up with an answer. I am using Netbeans for development and I cannot understand where to put my log4j.xml file, nor can I seem to figure out the concept. I have created the simplest project, I have tried the Properties loader but from what I have read it seems that log4j looks for the log4j.xml file: public class Main { static Logger logger = Logger.getLogger(Main.class); static Properties properties = new Properties(); static FileInputStream fis; /** * @param args the command line arguments */ public static void main(String[] args) { logger.info("info"); logger.debug("debug"); logger.warn("warn"); } } I added log4j.xml into the src folder: http://jakarta.apache.org/log4j/";> %c{1}:%L - %m%n"/> I can only seem to get this to act properly when I "clean and build". Which makes no sense to me, the whole point of a config file is to change before run, but I am only getting the desired result if the code is essentially burned in. Further more, when I try to distribute my jar I place the xml file in my dist folder but it just does not work. At this point I am just beyond frustration, any help would be appreciated. I realize that this is the most basic of problems and I apologize. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: XML config DOCTYPE error message
Hi Jacob: Thanks very much. Sometimes you can't see whats right in front of you! John Jacob Kjome wrote: At 07:11 PM 1/20/2006 -0700, you wrote: >I am using an XML config file (posted below). I always get the following >error message when starting the application: > >log4j:ERROR Parsing error on line 2 and column 83 >log4j:ERROR Document root element "log4j:configuration", must match DOCTYPE >root "null". >log4j:ERROR Parsing error on line 2 and column 83 >log4j:ERROR Document is invalid: no grammar found. > >It doesnt appear to affect anything, but its annoying. Anyone know how to >fix or get rid of message? Try adding this to the second line (the line below )... > >Thanks! > > >xmlns:log4j='http://jakarta.apache.org/log4j/'> > > > > > > > > > > > > > > > > > > > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML config DOCTYPE error message
At 07:11 PM 1/20/2006 -0700, you wrote: >I am using an XML config file (posted below). I always get the following >error message when starting the application: > >log4j:ERROR Parsing error on line 2 and column 83 >log4j:ERROR Document root element "log4j:configuration", must match DOCTYPE >root "null". >log4j:ERROR Parsing error on line 2 and column 83 >log4j:ERROR Document is invalid: no grammar found. > >It doesnt appear to affect anything, but its annoying. Anyone know how to >fix or get rid of message? Try adding this to the second line (the line below )... > >Thanks! > > >xmlns:log4j='http://jakarta.apache.org/log4j/'> > > > > > > > > > > > > > > > > > > > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML config questino
I too am looking for the answer to that one... Frank W. Zammetti wrote: Is there any way to EXCLUDE something, an individual class or classes specifically, that would normally be included in a category? That would do the trick I think. If not, I suppose I could set up multiple categories, but because I'd have to exclude individual classes from multiple packages, it essentially means poerhaps hundreds of categories for the classes that SHOULD be included. Clearly not the right answer :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XML config questino
Ouch. I have to be careful what I do because this app is moving to standard Java logging under JCL at some point in the future, and I don't want to make that conversion any more difficult than I have to. I did just discover the LevelRangeFilter, and that seems like it might do what I want... Then I can limit the CONSOLE and APPINFOFILE appenders to debug-info, and limit APPERRORFILE to error-error. I *think* that will do what I want. Like I said, that might cause me a problem down the road when I have to move off Log4J, but I'm still hoping that won't happen (probably a losing battle though), and this seems like a fairly simple answer, assuming it works like I think. Does anyone know what the performance implications of using a filter is? I kind of assume there is a filter that is used all the time anyway and I'm just replacing that, is that right? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 4:22 pm, Ford, Peter said: > > We had a similar problem in one application. What we ended up doing was > creating separate loggers for debug, info and error messages. To make > life easier we then created local debug(), info() and error() methods > that directed the message to the correct logger. Slightly messy but it > did the trick and we didn't have to write custom filters. > > --Pete > >> -Original Message- >> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] >> Sent: Thursday, July 07, 2005 3:05 PM >> To: Log4J Users List >> Cc: Log4J Users List >> Subject: RE: XML config questino >> >> That's correct, that's indeed what happens (I hope I didn't botch the >> explanation before!) >> >> The problem though is that I have about 10 packages to log, hence the >> com.company specification, to cover them all. However, now >> I'm trying to >> exclude certain classes, about 20 it looks like, spread >> across almost all >> 10 packages. >> >> From what I understand (I think!), unless there is a way to exclude >> certain things from a category, I'd have to (a) write a custom filter, >> which might be an option or (b) set up a category that >> includes all the >> classes EXCEPT those I don't want logged... while some I may >> be able to >> catch at the package level, most I won't because they would >> include some >> of those "do not log" classes, so I'm looking at potentially >> hundreds of >> category definitions at the class level... obviously not the >> way to go :) >> >> -- >> Frank W. Zammetti >> Founder and Chief Software Architect >> Omnytex Technologies >> http://www.omnytex.com >> >> On Thu, July 7, 2005 3:55 pm, Ford, Peter said: >> > >> > The way I read this, if you call log.error() then the >> message will be >> > logged to the APPINFOFILE and APPERRORFILE appenders >> because the level >> > of the message ("error") is >= the threshold level on both appenders >> > (one is ERROR, the other is DEBUG). I think. >> > >> > --Pete >> > >> >> -Original Message- >> >> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] >> >> Sent: Thursday, July 07, 2005 2:45 PM >> >> To: log4j-user@logging.apache.org >> >> Subject: XML config questino >> >> >> >> Hi all... I have what I thought would be a simple >> question, but it's >> >> completely beating me... >> >> >> >> I am using the XML config file seen below, Log4J 1.2.8. >> The problem I >> >> have is that anything that calls log.error() in my code goes to >> >> appError.log as I want, but it *ALSO* goes to appInfo.log. I >> >> need it to >> >> *ONLY* go to appError.log. >> >> >> >> Problem is, I haven't been able to figure out how to >> >> configure that. I >> >> thought I could just add another category, but because I have >> >> classes all >> >> throughout the app in various packages, this doesn't seem to >> >> be the right >> >> answer. >> >> >> >> Can anyone point me in the right direction? Thanks! >> >> >> >> >> >> >> >> > xmlns:log4j="http://jakarta.apache.org/log4j/";> >> >> > class="org.apache.log4j.ConsoleAppender"> >> >> >> >> >> >> >> >> >> >&g
RE: XML config questino
We had a similar problem in one application. What we ended up doing was creating separate loggers for debug, info and error messages. To make life easier we then created local debug(), info() and error() methods that directed the message to the correct logger. Slightly messy but it did the trick and we didn't have to write custom filters. --Pete > -Original Message- > From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 07, 2005 3:05 PM > To: Log4J Users List > Cc: Log4J Users List > Subject: RE: XML config questino > > That's correct, that's indeed what happens (I hope I didn't botch the > explanation before!) > > The problem though is that I have about 10 packages to log, hence the > com.company specification, to cover them all. However, now > I'm trying to > exclude certain classes, about 20 it looks like, spread > across almost all > 10 packages. > > From what I understand (I think!), unless there is a way to exclude > certain things from a category, I'd have to (a) write a custom filter, > which might be an option or (b) set up a category that > includes all the > classes EXCEPT those I don't want logged... while some I may > be able to > catch at the package level, most I won't because they would > include some > of those "do not log" classes, so I'm looking at potentially > hundreds of > category definitions at the class level... obviously not the > way to go :) > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > > On Thu, July 7, 2005 3:55 pm, Ford, Peter said: > > > > The way I read this, if you call log.error() then the > message will be > > logged to the APPINFOFILE and APPERRORFILE appenders > because the level > > of the message ("error") is >= the threshold level on both appenders > > (one is ERROR, the other is DEBUG). I think. > > > > --Pete > > > >> -Original Message- > >> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] > >> Sent: Thursday, July 07, 2005 2:45 PM > >> To: log4j-user@logging.apache.org > >> Subject: XML config questino > >> > >> Hi all... I have what I thought would be a simple > question, but it's > >> completely beating me... > >> > >> I am using the XML config file seen below, Log4J 1.2.8. > The problem I > >> have is that anything that calls log.error() in my code goes to > >> appError.log as I want, but it *ALSO* goes to appInfo.log. I > >> need it to > >> *ONLY* go to appError.log. > >> > >> Problem is, I haven't been able to figure out how to > >> configure that. I > >> thought I could just add another category, but because I have > >> classes all > >> throughout the app in various packages, this doesn't seem to > >> be the right > >> answer. > >> > >> Can anyone point me in the right direction? Thanks! > >> > >> > >> > >> xmlns:log4j="http://jakarta.apache.org/log4j/";> > >>class="org.apache.log4j.ConsoleAppender"> > >> > >> > >> > >> > >> > >>class="org.apache.log4j.FileAppender"> > >> > >> > >> > >> > >> > >> > >> > >>class="org.apache.log4j.FileAppender"> > >> > >> > >> > >> > >> > >> > >> > >>class="org.apache.log4j.FileAppender"> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >>>> name="com.company.app.daemonthreads.AgingProcessDaemonThread" > >> additivity="true"> > >> > >> > >> > >> > >> -- > >> Frank W. Zammetti > >> Founder and Chief Software Architect > >> Omnytex Technologies > >> http://www.omnytex.com > >> > >> > - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XML config questino
That's correct, that's indeed what happens (I hope I didn't botch the explanation before!) The problem though is that I have about 10 packages to log, hence the com.company specification, to cover them all. However, now I'm trying to exclude certain classes, about 20 it looks like, spread across almost all 10 packages. >From what I understand (I think!), unless there is a way to exclude certain things from a category, I'd have to (a) write a custom filter, which might be an option or (b) set up a category that includes all the classes EXCEPT those I don't want logged... while some I may be able to catch at the package level, most I won't because they would include some of those "do not log" classes, so I'm looking at potentially hundreds of category definitions at the class level... obviously not the way to go :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 3:55 pm, Ford, Peter said: > > The way I read this, if you call log.error() then the message will be > logged to the APPINFOFILE and APPERRORFILE appenders because the level > of the message ("error") is >= the threshold level on both appenders > (one is ERROR, the other is DEBUG). I think. > > --Pete > >> -Original Message- >> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] >> Sent: Thursday, July 07, 2005 2:45 PM >> To: log4j-user@logging.apache.org >> Subject: XML config questino >> >> Hi all... I have what I thought would be a simple question, but it's >> completely beating me... >> >> I am using the XML config file seen below, Log4J 1.2.8. The problem I >> have is that anything that calls log.error() in my code goes to >> appError.log as I want, but it *ALSO* goes to appInfo.log. I >> need it to >> *ONLY* go to appError.log. >> >> Problem is, I haven't been able to figure out how to >> configure that. I >> thought I could just add another category, but because I have >> classes all >> throughout the app in various packages, this doesn't seem to >> be the right >> answer. >> >> Can anyone point me in the right direction? Thanks! >> >> >> >> http://jakarta.apache.org/log4j/";> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > name="com.company.app.daemonthreads.AgingProcessDaemonThread" >> additivity="true"> >> >> >> >> >> -- >> Frank W. Zammetti >> Founder and Chief Software Architect >> Omnytex Technologies >> http://www.omnytex.com >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XML config questino
Is there any way to EXCLUDE something, an individual class or classes specifically, that would normally be included in a category? That would do the trick I think. If not, I suppose I could set up multiple categories, but because I'd have to exclude individual classes from multiple packages, it essentially means poerhaps hundreds of categories for the classes that SHOULD be included. Clearly not the right answer :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 3:51 pm, Balaji Saranathan said: > >>From your code > > > > > > > > Any loggers that are created with the classnames following this packages > structure will have three appenders attached to it and hence will > forward to all the three > > > > -Original Message- > From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 07, 2005 3:45 PM > To: log4j-user@logging.apache.org > Subject: XML config questino > > > Hi all... I have what I thought would be a simple question, but it's > completely beating me... > > I am using the XML config file seen below, Log4J 1.2.8. The problem I > have is that anything that calls log.error() in my code goes to > appError.log as I want, but it *ALSO* goes to appInfo.log. I need it to > *ONLY* go to appError.log. > > Problem is, I haven't been able to figure out how to configure that. I > thought I could just add another category, but because I have classes > all throughout the app in various packages, this doesn't seem to be the > right answer. > > Can anyone point me in the right direction? Thanks! > > > xmlns:log4j="http://jakarta.apache.org/log4j/";> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >name="com.company.app.daemonthreads.AgingProcessDaemonThread" > additivity="true"> > > > > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > Confidentiality Notice > > The information contained in this electronic message and any attachments > to this message are intended > for the exclusive use of the addressee(s) and may contain confidential or > privileged information. If > you are not the intended recipient, please notify the sender at Wipro or > [EMAIL PROTECTED] immediately > and destroy all copies of this message and any attachments. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XML config questino
The way I read this, if you call log.error() then the message will be logged to the APPINFOFILE and APPERRORFILE appenders because the level of the message ("error") is >= the threshold level on both appenders (one is ERROR, the other is DEBUG). I think. --Pete > -Original Message- > From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 07, 2005 2:45 PM > To: log4j-user@logging.apache.org > Subject: XML config questino > > Hi all... I have what I thought would be a simple question, but it's > completely beating me... > > I am using the XML config file seen below, Log4J 1.2.8. The problem I > have is that anything that calls log.error() in my code goes to > appError.log as I want, but it *ALSO* goes to appInfo.log. I > need it to > *ONLY* go to appError.log. > > Problem is, I haven't been able to figure out how to > configure that. I > thought I could just add another category, but because I have > classes all > throughout the app in various packages, this doesn't seem to > be the right > answer. > > Can anyone point me in the right direction? Thanks! > > > > http://jakarta.apache.org/log4j/";> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >name="com.company.app.daemonthreads.AgingProcessDaemonThread" > additivity="true"> > > > > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML config questino
You would probably have to write a custom filter. Normally appenders get everything from the specified level _and above_. On 7/7/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > Hi all... I have what I thought would be a simple question, but it's > completely beating me... > > I am using the XML config file seen below, Log4J 1.2.8. The problem I > have is that anything that calls log.error() in my code goes to > appError.log as I want, but it *ALSO* goes to appInfo.log. I need it to > *ONLY* go to appError.log. > > Problem is, I haven't been able to figure out how to configure that. I > thought I could just add another category, but because I have classes all > throughout the app in various packages, this doesn't seem to be the right > answer. > > Can anyone point me in the right direction? Thanks! -- James Stauffer Are you good? Take the test at http://www.livingwaters.com/good/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XML config questino
>From your code Any loggers that are created with the classnames following this packages structure will have three appenders attached to it and hence will forward to all the three -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 3:45 PM To: log4j-user@logging.apache.org Subject: XML config questino Hi all... I have what I thought would be a simple question, but it's completely beating me... I am using the XML config file seen below, Log4J 1.2.8. The problem I have is that anything that calls log.error() in my code goes to appError.log as I want, but it *ALSO* goes to appInfo.log. I need it to *ONLY* go to appError.log. Problem is, I haven't been able to figure out how to configure that. I thought I could just add another category, but because I have classes all throughout the app in various packages, this doesn't seem to be the right answer. Can anyone point me in the right direction? Thanks! http://jakarta.apache.org/log4j/";> -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML config questino
Ha, just noticed the typo in my subject... questino... did I just discover a new subatomic particle?!? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 3:44 pm, Frank W. Zammetti said: > Hi all... I have what I thought would be a simple question, but it's > completely beating me... > > I am using the XML config file seen below, Log4J 1.2.8. The problem I > have is that anything that calls log.error() in my code goes to > appError.log as I want, but it *ALSO* goes to appInfo.log. I need it to > *ONLY* go to appError.log. > > Problem is, I haven't been able to figure out how to configure that. I > thought I could just add another category, but because I have classes all > throughout the app in various packages, this doesn't seem to be the right > answer. > > Can anyone point me in the right direction? Thanks! > > > > http://jakarta.apache.org/log4j/";> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >additivity="true"> > > > > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]