Joern Huxhorn | 2 May 23:38 2011

Lilith 0.9.41 has been released!

Lilith 0.9.41 - Release Notes

This is an interim release because of a rather critical bug discovered by
Andy Goossens. Webapps using a ClassicMultiplexSocketAppender would not
undeploy properly because of a dangling classloader.
I originally wanted to wait for Logback 0.9.29 due to the issues with 0.9.28
described in "Known Issues" below but I was unable to get any ETA for the
next release.

Changes:
- The NDC behavior has changed a bit since it does not inherit the NDC of
  the parent threads anymore.
  This is actually a better behavior. Inheriting does not make much sense
  for an NDC - in contrast to MDC where it is very helpful - since it
  resembles a contextual "stacktrace".
  I never documented the previous behavior, anyway. Problem? ;) 
- Fixed two classloader-leak-issues that prevented proper unloading of
  webapps upon undeploy/redeploy.
  1.) The threads startet by the Lilith multiplex appenders did stop but
      I didn't bother to wait until they finished doing so. This has been
      fixed now. All threads are destroyed before stop() returns.
  2.) I had an issue in the NDC implementation that was very comparable
      to the one that caused LBCLASSIC-183.
      I was putting an instance of a class loaded by the webapp classloader
      into a ThreadLocal. I fixed this by using two ThreadLocals, 
      a ThreadLocal<String> and a ThreadLocal<String[]>,
      instead of my own class.
  This issue was discovered and reported by Andy Goossens.
  Thank you very much! (issue #96)
- Minimize to system tray.
(Continue reading)

Dasgupta, Ranjan | 9 May 23:55 2011
Picon

LikeRule in Apache Extras Companion (used by ExpressionFilter)

In the LikeRule evaluate(...) method, the matcher uses the matcher.matches(...) which checks for the
whole string to match to. Shouldn't it be using the matcher.find(), so that we do not log if a part of the log
string matched the pattern provided? Or is there any other way of doing that?
I am trying not to log messages that match \\b\\d{13,16}\\b

                        <filter class="org.apache.log4j.filter.ExpressionFilter">
                                <param name="Expression" value="MSG LIKE \\b\\d{13,16}\\b"/>
                                <param name="AcceptOnMatch" value="false"/>
                        </filter>
Thanks,
Ranjan Dasgupta

Scott Deboy | 10 May 07:32 2011
Picon

Re: LikeRule in Apache Extras Companion (used by ExpressionFilter)

I tried this in Chainsaw and it worked fine...note the single quotes and
adding .* before and after the expression..single quotes probably aren't
necessary unless you have spaces in your regexp..one other thing: I'm not
escaping the slashes since you don't have to escape them in Chainsaw.

msg like '.*\b\(\d{3}\)\s.*'

matches this entry:
743 - 2011/04/27 14:23:57 -  - DEBUG - Unknown - 20110427 14:25:38.605
ERROR    RI.TEST- testAppThread accept(316) failed? -  - AWT-EventQueue-0

Scott

On Mon, May 9, 2011 at 2:55 PM, Dasgupta, Ranjan
<Ranjan_Dasgupta <at> dell.com>wrote:

> In the LikeRule evaluate(...) method, the matcher uses the
> matcher.matches(...) which checks for the whole string to match to.
> Shouldn't it be using the matcher.find(), so that we do not log if a part of
> the log string matched the pattern provided? Or is there any other way of
> doing that?
> I am trying not to log messages that match \\b\\d{13,16}\\b
>
>                        <filter
> class="org.apache.log4j.filter.ExpressionFilter">
>                                <param name="Expression" value="MSG LIKE
> \\b\\d{13,16}\\b"/>
>                                <param name="AcceptOnMatch" value="false"/>
>                        </filter>
> Thanks,
(Continue reading)

Dasgupta, Ranjan | 10 May 16:52 2011
Picon

RE: LikeRule in Apache Extras Companion (used by ExpressionFilter)

Scott, thanks for the quick reply. After looking at your example, I ended up with something like:
MSG LIKE .*\\b\\d{13,16}.*

Appreciate your help.

Regards,
Ranjan Dasgupta

-----Original Message-----
From: Scott Deboy [mailto:scott.deboy <at> gmail.com] 
Sent: Tuesday, May 10, 2011 1:32 AM
To: Log4J Users List
Subject: Re: LikeRule in Apache Extras Companion (used by ExpressionFilter)

I tried this in Chainsaw and it worked fine...note the single quotes and
adding .* before and after the expression..single quotes probably aren't
necessary unless you have spaces in your regexp..one other thing: I'm not
escaping the slashes since you don't have to escape them in Chainsaw.

msg like '.*\b\(\d{3}\)\s.*'

matches this entry:
743 - 2011/04/27 14:23:57 -  - DEBUG - Unknown - 20110427 14:25:38.605
ERROR    RI.TEST- testAppThread accept(316) failed? -  - AWT-EventQueue-0

Scott

On Mon, May 9, 2011 at 2:55 PM, Dasgupta, Ranjan
<Ranjan_Dasgupta <at> dell.com>wrote:

(Continue reading)

Bruce Pease | 17 May 03:04 2011

log4j issue

I have an issue with log4j 1.2.16 where the max file size on the rolling file
appender is not working (also not on 1.2.15)  However, when I go back to my
previous log4j version (1.2.9), the file backups do work.  Was there a config
change, or is this a known issue?  My config is below:

log4j.rootLogger=INFO, VerboseLog, FatalLog

log4j.appender.VerboseLog=org.apache.log4j.RollingFileAppender

log4j.appender.VerboseLog.Threshold=DEBUG

log4j.appender.VerboseLog.Append=true

log4j.appender.VerboseLog.MaxFileSize=10MB

log4j.appender.VerboseLog.MaxBackupIndex=10

log4j.appender.VerboseLog.File=C:/var/tomcat1/logs/travel.log

log4j.appender.VerboseLog.layout=org.apache.log4j.PatternLayout

log4j.appender.VerboseLog.layout.ConversionPattern=%d [%-5p] %c -%m%n

log4j.appender.FatalLog=org.apache.log4j.RollingFileAppender

log4j.appender.FatalLog.Threshold=FATAL

log4j.appender.FatalLog.MaxFileSize=5MB

log4j.appender.FatalLog.MaxBackupIndex=2
(Continue reading)

Nitin Kumar Gupta | 17 May 17:33 2011
Picon

is it possible to have different log level for same package


suppose I have a package com.foo.hello ,

can I define log level and appender such that error logs goes to one file
and all other (even including error, if possible) goes to another file.

I tried as follows, but last one is always overwriting first one

log4j.logger.com.foo.hello=ERROR, FOO_1
log4j.logger.com.foo.hello=DEBUG, FOO_2

and appender as 

log4j.appender.FOO_1=org.apache.log4j.RollingFileAppender
log4j.appender.FOO_1.File=../log/foo_error.log
&
log4j.appender.FOO_2=org.apache.log4j.RollingFileAppender
log4j.appender.FOO_2.File=../log/foo_all.log

Can someone please help me on that?

Thanks a ton
Nitin

--

-- 
View this message in context: http://old.nabble.com/is-it-possible-to-have-different-log-level-for-same-package-tp31638492p31638492.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
niras iva | 21 May 07:15 2011

log4j


Hai Am new in log4j..i dunno how to create a new Appender ..please explain me
clearly
--

-- 
View this message in context: http://old.nabble.com/log4j-tp31669215p31669215.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Bender Heri | 23 May 10:39 2011
Picon

RE: is it possible to have different log level for same package

I am not sure about properties configuration. But with xml configuration I would do:

- define one logger (your package name, level debug)
- assign two appenders to this logger:
    - appender1: with level range filter error and higher
    - appender2: without level range filter

Heri

> -----Original Message-----
> From: Nitin Kumar Gupta [mailto:nitinkumargupta <at> gmail.com] 
> Sent: Tuesday, May 17, 2011 5:33 PM
> To: log4j-user <at> logging.apache.org
> Subject: is it possible to have different log level for same package
> 
> 
> suppose I have a package com.foo.hello ,
> 
> can I define log level and appender such that error logs goes 
> to one file and all other (even including error, if possible) 
> goes to another file.
> 
> I tried as follows, but last one is always overwriting first one
> 
> log4j.logger.com.foo.hello=ERROR, FOO_1
> log4j.logger.com.foo.hello=DEBUG, FOO_2
> 
> and appender as 
> 
> log4j.appender.FOO_1=org.apache.log4j.RollingFileAppender
(Continue reading)

Zbynek Vavros | 23 May 16:18 2011
Picon

using of system properties in subject of SMTPAppender


Hi,

I have a 1 server app and many clients app on different servers.
Obviously I wanted to know from which server the email comes, so I used
this:

log4j.xml
<appender name="email" class="org.apache.log4j.net.SMTPAppender">
      <param name="BufferSize" value="512" />
      <param name="SMTPHost" value="my_smtp_host" />
      <param name="From" value="AutoBot" />
      <param name="To" value="my_email <at> someserver.com" />
      <param name="Subject" value="Agent on [${HOSTNAME}] has encountered
error" />
      <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{HH:mm:ss} [%t] %p %C
(%L) %x - %m%n" />
      </layout>
      <filter class="org.apache.log4j.varia.LevelRangeFilter">
            <param name="LevelMin" value="error" />
            <param name="LevelMax" value="fatal" />
      </filter>
</appender>

and since system property has to be setup before configuring log4j, I use
this in my code.

Main class
//create system property to hold server name
(Continue reading)

Andy Flury | 23 May 21:58 2011
Picon

Set Root Log Level on command line

Hi All

Is there a way to set the root log level on the command line?

We have an application that runs either in Simulation mode or in Live mode.
Depending on the mode, the log level needs to be debug or error. It would be
very inconvenient to have two different log4j config files, because all
other settings will be constant.

thanks for your help

andy flury


Gmane