Re: Filters
darn...I believe we are using 1.29 Jacob Kjome wrote: > > Quoting James Stauffer <[EMAIL PROTECTED]>: > >> Code in log4j should only use LogLog for logging > > Note that this is true for Log4j versions previous to 1.3alpha, but as of > 1.3alpha, Log4j uses itself for logging (except for the short time prior > to > bootstrapping itself). > > Jake > >>, which is only sent >> to standard out. I don't have any good ideas unless you change the >> message of the LogEvent that gets through. >> >> On 11/8/06, vincentw <[EMAIL PROTECTED]> wrote: >> > >> > Hi, >> > >> > I'm trying to filter the log message and I can do it. But I what I >> would >> > like to do is, keep track of how many times the message was filtered, >> and >> > when a new message comes in, log how many times the previous message >> was >> > filtered and then the new message. >> > >> > I tried using the a logger inside that class but I think I remember >> reading >> > something about can't log inside of log4j. >> > >> > So how can I go about this? >> > >> > Thanks >> > >> > vincent >> > -- >> > View this message in context: >> http://www.nabble.com/Filters-tf2598830.html#a7249900 >> > Sent from the Log4j - Users mailing list archive at Nabble.com. >> > >> > >> > - >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> > >> >> >> -- >> James Staufferhttp://www.geocities.com/stauffer_james/ >> 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] >> > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-log-inside-a-filter-tf2598830.html#a7266845 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Filters
Hi, I'm trying to filter the log message and I can do it. But I what I would like to do is, keep track of how many times the message was filtered, and when a new message comes in, log how many times the previous message was filtered and then the new message. I tried using the a logger inside that class but I think I remember reading something about can't log inside of log4j. So how can I go about this? Thanks vincent -- View this message in context: http://www.nabble.com/Filters-tf2598830.html#a7249900 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RollingFileAppender Not rolling over
Does the header print out depend on logging level?? What I'm seeing is if I set the level to anything but debug the header info will not be displayed. Anyone come across this or have any ideas? Thanks vincentw wrote: > > Hi, I'm having trouble with thr RFA not rollingover. Here is my config > > > > > http://jakarta.apache.org/log4j/"; > debug="false"> > > > > > > > > > > > > > > > > > > > > > > > > > I'm running into this problem after I have extended the Layout class. I > extended the layout class so I can have header info in each of the log > files. If I used > >value="%d{-MM-dd HH:mm:ss} %-17X{ipAddress} [%t] [%p] - %m%n"/> > > instead I have no rollover problems. > > Now what I see is I just get one file of 4KB rolling over onto itself, but > I get the header info. > > Any ideas?? > > Thanks in advance > -- View this message in context: http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7203739 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RollingFileAppender Not rolling over
Yes it does work when using standard layout class. James Stauffer wrote: > > Does it work if you use the standard layout class? > > On 11/1/06, vincentw <[EMAIL PROTECTED]> wrote: >> >> Hi, I'm having trouble with thr RFA not rollingover. Here is my config >> >> >> >> >> http://jakarta.apache.org/log4j/"; >> debug="false"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> I'm running into this problem after I have extended the Layout class. I >> extended the layout class so I can have header info in each of the log >> files. If I used >> >> > value="%d{-MM-dd HH:mm:ss} %-17X{ipAddress} [%t] [%p] - %m%n"/> >> >> instead I have no rollover problems. >> >> Now what I see is I just get one file of 4KB rolling over onto itself, >> but I >> get the header info. >> >> Any ideas?? >> >> Thanks in advance >> -- >> View this message in context: >> http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7123228 >> Sent from the Log4j - Users mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > James Staufferhttp://www.geocities.com/stauffer_james/ > 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] > > > -- View this message in context: http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7141878 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RollingFileAppender Not rolling over
Hi, I'm having trouble with thr RFA not rollingover. Here is my config http://jakarta.apache.org/log4j/"; debug="false"> I'm running into this problem after I have extended the Layout class. I extended the layout class so I can have header info in each of the log files. If I used instead I have no rollover problems. Now what I see is I just get one file of 4KB rolling over onto itself, but I get the header info. Any ideas?? Thanks in advance -- View this message in context: http://www.nabble.com/RollingFileAppender-Not-rolling-over-tf2556156.html#a7123228 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Header info for rolling back up files
Hi, how can I get some header info into each of the rolling back up files I create? Thanks in advance Vincent -- View this message in context: http://www.nabble.com/Header-info-for-rolling-back-up-files-tf2517167.html#a7020779 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I change log4j configuration programatically?
Its seems the new level doesn't take effect. So here's what I'm trying to do. I call a function "initLogging" to set up everything...call DOMConfigurator and pass it my log4j.xml file. So now log4j is setup with some default stuff. Now the cofig file may change the settings ie. logging level. Here's part of the code that does a check for config file ... if(useUserConfigFile) { aLogger.setMaxBackupIndex(zxConfig.getProperty("numLogs")); aLogger.setMaxFileSize(Long.parseLong(zxConfi.getProperty("logSize"))); a.setLoggingLevel("root", zxConfig.getProperty("rootLogLevel")); a.setLoggingLevel("sql.xxx.xxx", zxConfig.getProperty("sqlLogLevel")); } Here is part of the code to set the new logging... ... Enumeration enLogger = Logger.getRootLogger().getLoggerRepository().getCurrentLoggers(); Logger tmpLogger = null; /* If logger is root, then need to loop through all loggers under root * and change their logging levels too. Also, skip sql loggers so they * do not get effected. */ while(enLogger.hasMoreElements()) { tmpLogger = (Logger)(enLogger.nextElement()); if(tmpLogger.getName().startsWith("sql.xxx.xxx") && logger.equals("sql.xxx.xxxi")) { tmpLogger.setLevel(Level.toLevel(level)); continue; } if(tmpLogger.getName().startsWith("xxx.xx") && logger.equals("root")) { tmpLogger.setLevel(Level.toLevel(level)); } } while(enAppenders.hasMoreElements()) { appender = (Appender)enAppenders.nextElement(); if(appender.getName().equals("ASYNC")) { AsyncAppender asyncAppender = (AsyncAppender)appender; rfa = (RollingFileAppender)asyncAppender.getAppender("R"); rfa.activateOptions(); ca = (ConsoleAppender)asyncAppender.getAppender("STDOUT"); ca.activateOptions(); } } Another question is, at this point, I have use getLogger for a lot of packages. Now I want to change to logging level of my root package, and everything under it. I need to loop through all loggers like I have in the code right? Or is there a better way of doing this? Thanks -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6784793 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I change log4j configuration programatically?
Sorry, I found it...using the wrong object. Thanks James Stauffer wrote: > > AppenderSkeleton has activateOptions() and SMTPAppender extends > AppenderSkeleton so it should work. What version do you have? I > would be surprised if any 1.2.x version that is less than a fre years > old doesn't have that. > > On 10/12/06, vincentw <[EMAIL PROTECTED]> wrote: >> >> It appears that I don't have that method...how do I get it? Do I have an >> older version? >> >> >> James Stauffer wrote: >> > >> > I believe you call it on the appender after you change its settings. >> > >> > On 10/11/06, vincentw <[EMAIL PROTECTED]> wrote: >> >> >> >> What would I call activateOptions() with? >> >> >> >> >> >> Bender Heri wrote: >> >> > >> >> > Yes, you can. Don't forget to call activateOptions() at the end of >> >> > reconfiguring. You need not to restart the app. >> >> > Heri >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6762094 >> >> Sent from the Log4j - Users mailing list archive at Nabble.com. >> >> >> >> >> >> - >> >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> > >> > >> > -- >> > James Staufferhttp://www.geocities.com/stauffer_james/ >> > 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] >> > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6783730 >> Sent from the Log4j - Users mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > James Staufferhttp://www.geocities.com/stauffer_james/ > 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] > > > -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6784340 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I change log4j configuration programatically?
It appears that I don't have that method...how do I get it? Do I have an older version? James Stauffer wrote: > > I believe you call it on the appender after you change its settings. > > On 10/11/06, vincentw <[EMAIL PROTECTED]> wrote: >> >> What would I call activateOptions() with? >> >> >> Bender Heri wrote: >> > >> > Yes, you can. Don't forget to call activateOptions() at the end of >> > reconfiguring. You need not to restart the app. >> > Heri >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6762094 >> Sent from the Log4j - Users mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > James Staufferhttp://www.geocities.com/stauffer_james/ > 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] > > > -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6783730 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I change log4j configuration programatically?
What would I call activateOptions() with? Bender Heri wrote: > > Yes, you can. Don't forget to call activateOptions() at the end of > reconfiguring. You need not to restart the app. > Heri > > -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6762094 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I change log4j configuration programatically?
Well, I use DOMConfigurator initially, but what about when the program is running?? I would like to set a new root level or a log file size. Can I do something like Logger.getRootLogger.setLevel or something like that? If I do it this way do I have to stop and restart the logger? James Stauffer wrote: > > A stand-alone Java application could use > DOMConfigurator.configureAndWatch (but don't allow it to do automatic > configuration). > > -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6760580 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I change log4j configuration programatically?
I see...no it's just a standalone Java application. James is probably wondering whether your code is running in a web container, such as Tomcat. In that case, LogWeb might be able to help http://www.codeczar.com/products/logweb/ It works great for me! Jake -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6757073 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I change log4j configuration programatically?
I'm don't quite understand the question. it's a java application. James Stauffer wrote: > > In what kind of environment are you running? > > On 10/10/06, vincentw <[EMAIL PROTECTED]> wrote: >> >> Hi I'm new to using log4j and would like to know if I can change the >> configuration of log4j while it is already running. I have passed my >> log4j.xml to the DOMConfigurator and then I would like to change some >> settings. >> >> Here is my log4j.xml file >> >> >> >> http://jakarta.apache.org/log4j/"; >> debug="false"> >> >> >> >> >> >> >> >> >> >> >> > value="%d{ISO8601} %-17X{ipAddress} [%t] [%p] - %m%n"/> >> >> >> >> >> >> >> >> >> > value="%d{ISO8601} %-17X{ipAddress} [%t] [%p] - %m%n"/> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Now based on a user config file, I would like to change some of the >> config >> such as the MaxFileSize of the rolling file appender or the number of >> backup >> logs it keeps. I would also like to change the logging level of root or >> sql. >> >> Is it possible to to this? If so, how do I go about doing this? >> >> Thanks in advance >> -- >> View this message in context: >> http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6747745 >> Sent from the Log4j - Users mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > James Staufferhttp://www.geocities.com/stauffer_james/ > 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] > > > -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6750178 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can I change log4j configuration programatically?
Hi I'm new to using log4j and would like to know if I can change the configuration of log4j while it is already running. I have passed my log4j.xml to the DOMConfigurator and then I would like to change some settings. Here is my log4j.xml file http://jakarta.apache.org/log4j/"; debug="false"> Now based on a user config file, I would like to change some of the config such as the MaxFileSize of the rolling file appender or the number of backup logs it keeps. I would also like to change the logging level of root or sql. Is it possible to to this? If so, how do I go about doing this? Thanks in advance -- View this message in context: http://www.nabble.com/Can-I-change-log4j-configuration-programatically--tf2420301.html#a6747745 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]