Re: Telegram based DailyRollingFile appender?

2009-07-14 Thread collatz

Hi,

I'm writing on a Windows 2003 Server, so i think it is beeing done with the
Common Internet File System (CIFS) protocol.


Ceki Gulcu wrote:
 
 
 Hello,
 
 What kind of protocol are you using to write to the file servers? Is it
 NFS or 
 something else?
 
 
 
 -- 
 Ceki Gülcü
 Logback: The reliable, generic, fast and flexible logging framework for
 Java.
 http://logback.qos.ch
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Telegram-based-DailyRollingFile-appender--tp24462850p24474423.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



AW: using a different log4j.properties file per classes directory

2009-07-14 Thread Bender Heri
 which then causes all the tabs based logging to occur in a separate
file (defined under the T log definition).  The log entries from tabs
are repeated  into the root logger, which is not ideal but I can deal
with.

Have a look at the Additive property of logger/category, and set it to
false (BTW: Logger and Category are semantically the same, the
latter is older and deprecated. You should use Logger instead.)
Heri


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: using a different log4j.properties file per classes directory

2009-07-14 Thread Jacob Kjome
Are you saying that you get INFO (as well as WARN, ERROR, and FATAL) logging 
from the com.tabs logger (and children) in the R appender associated with 
the rootLogger?  That's to be expected, as the com.tabs logger (and 
children) inherits appenders from parent loggers unless additivity is set to 
false.


While you can set...

log4j.additivity.com.tabs=false

...I recommend you simply change your root logger to log at a more strict 
level that will log a bit less, such as WARN.  If you want less restrictive 
logging for certain things, then you can define those separately.  This should 
minimize what gets logged to your R appender and make it easier to grok.



Jake

On Mon, 13 Jul 2009 22:58:32 -0400
 Lucas Vickers lucasvick...@gmail.com wrote:

I'm using tomcat 5.5.25

I modified the log4j in the commons dir:
common/classes/log4j.properties

and added two seporate logging definitions based on class:

log4j.rootLogger=INFO, R

log4j.category.com.tabs=REBUG, T

in my java code I define the logger as:
Logger log = Logger.getLogger(com.tabs.servlet);

which then causes all the tabs based logging to occur in a separate file
(defined under the T log definition).  The log entries from tabs are
repeated into the root logger, which is not ideal but I can deal with.

Lucas

On Mon, Jul 13, 2009 at 3:54 AM, Jacob Kjome h...@visi.com wrote:


Work for me.  Different versions require different setups.  5.5 required
log4j.jar
and commons-logging.jar in common/lib.  6.x requries you to manually
rebuild their
custom logging framework to work with Log4j.  By default, it's hard-wired
to JUL.
 So, all that can be considered fishy.  I've never really had an issue
with the
per-app logging when placing log4j.jar in WEB-INF/lib even with another
copy in
common/lib.  What issues have you run into?

Jake

On 7/13/2009 12:30 AM, Yair Ogen wrote:
 log4j under Tomcat is known to be fishy regarding class path.
 Are you sure this suggestion works?

 On Mon, Jul 13, 2009 at 10:27 AM, Jacob Kjome h...@visi.com wrote:

 You have to deploy log4j.jar in both common/lib as well as WEB-INF/lib
of
 each
 app.  Tomcat will use the one in common/lib and each webapp will use the
 one in
 its respective WEB-INF/lib (because of child-first, or parent-last,
 classloading
 behavior of webapps).

 Jake

 On 7/11/2009 6:01 PM, Lucas Vickers wrote:
 Hello,
 Excuse my simple question as I am new to tomcat/log4j.
 I have looked at the mailing list and did some googling but no luck.

 What I would like to do is have my tomcat installation use one log
file,
 and
 then my own servlet use a different log file.

 ./common/classes/log4j.properties =

 log4j.rootLogger=INFO, R
 log4j.appender.R=org.apache.log4j.RollingFileAppender
 log4j.appender.R.File=${catalina.home}/logs/tomcat.log
 log4j.appender.R.MaxFileSize=100MB
 log4j.appender.R.MaxBackupIndex=50
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

 ./webapps/servlets-examples/WEB-INF/classes/log4j.properties =

 log4j.rootLogger=DEBUG, R
 log4j.appender.R=org.apache.log4j.RollingFileAppender
 log4j.appender.R.File=${catalina.home}/logs/tabs.log
 log4j.appender.R.MaxFileSize=10MB
 log4j.appender.R.MaxBackupIndex=100
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

 Ideal result is that my class in /servlets-examples will be in DEBUG
 level
 and will output to the tabs.log

 It appears that my servlet-examples is outputting to tomcat.og and is
in
 INFO level.

 Could anyone please help me figure out what I am missing.
 Many thanks,
 Lucas

 -
 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





-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: using a different log4j.properties file per classes directory

2009-07-14 Thread Lucas Vickers
Correct I am getting all the DEBUG/INFO/WARN/FATAL from tabs in the root
logger.

I will try setting additivity to false.

thanks :)

On Tue, Jul 14, 2009 at 10:42 AM, Jacob Kjome h...@visi.com wrote:

 Are you saying that you get INFO (as well as WARN, ERROR, and FATAL)
 logging from the com.tabs logger (and children) in the R appender
 associated with the rootLogger?  That's to be expected, as the com.tabs
 logger (and children) inherits appenders from parent loggers unless
 additivity is set to false.

 While you can set...

 log4j.additivity.com.tabs=false

 ...I recommend you simply change your root logger to log at a more strict
 level that will log a bit less, such as WARN.  If you want less
 restrictive logging for certain things, then you can define those
 separately.  This should minimize what gets logged to your R appender and
 make it easier to grok.


 Jake


 On Mon, 13 Jul 2009 22:58:32 -0400
  Lucas Vickers lucasvick...@gmail.com wrote:

 I'm using tomcat 5.5.25

 I modified the log4j in the commons dir:
 common/classes/log4j.properties

 and added two seporate logging definitions based on class:

 log4j.rootLogger=INFO, R

 log4j.category.com.tabs=REBUG, T

 in my java code I define the logger as:
 Logger log = Logger.getLogger(com.tabs.servlet);

 which then causes all the tabs based logging to occur in a separate file
 (defined under the T log definition).  The log entries from tabs are
 repeated into the root logger, which is not ideal but I can deal with.

 Lucas

 On Mon, Jul 13, 2009 at 3:54 AM, Jacob Kjome h...@visi.com wrote:

  Work for me.  Different versions require different setups.  5.5 required
 log4j.jar
 and commons-logging.jar in common/lib.  6.x requries you to manually
 rebuild their
 custom logging framework to work with Log4j.  By default, it's hard-wired
 to JUL.
  So, all that can be considered fishy.  I've never really had an issue
 with the
 per-app logging when placing log4j.jar in WEB-INF/lib even with another
 copy in
 common/lib.  What issues have you run into?

 Jake

 On 7/13/2009 12:30 AM, Yair Ogen wrote:
  log4j under Tomcat is known to be fishy regarding class path.
  Are you sure this suggestion works?
 
  On Mon, Jul 13, 2009 at 10:27 AM, Jacob Kjome h...@visi.com wrote:
 
  You have to deploy log4j.jar in both common/lib as well as WEB-INF/lib
 of
  each
  app.  Tomcat will use the one in common/lib and each webapp will use
 the
  one in
  its respective WEB-INF/lib (because of child-first, or parent-last,
  classloading
  behavior of webapps).
 
  Jake
 
  On 7/11/2009 6:01 PM, Lucas Vickers wrote:
  Hello,
  Excuse my simple question as I am new to tomcat/log4j.
  I have looked at the mailing list and did some googling but no luck.
 
  What I would like to do is have my tomcat installation use one log
 file,
  and
  then my own servlet use a different log file.
 
  ./common/classes/log4j.properties =
 
  log4j.rootLogger=INFO, R
  log4j.appender.R=org.apache.log4j.RollingFileAppender
  log4j.appender.R.File=${catalina.home}/logs/tomcat.log
  log4j.appender.R.MaxFileSize=100MB
  log4j.appender.R.MaxBackupIndex=50
  log4j.appender.R.layout=org.apache.log4j.PatternLayout
  log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
 
  ./webapps/servlets-examples/WEB-INF/classes/log4j.properties =
 
  log4j.rootLogger=DEBUG, R
  log4j.appender.R=org.apache.log4j.RollingFileAppender
  log4j.appender.R.File=${catalina.home}/logs/tabs.log
  log4j.appender.R.MaxFileSize=10MB
  log4j.appender.R.MaxBackupIndex=100
  log4j.appender.R.layout=org.apache.log4j.PatternLayout
  log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
 
  Ideal result is that my class in /servlets-examples will be in DEBUG
  level
  and will output to the tabs.log
 
  It appears that my servlet-examples is outputting to tomcat.og and is
 in
  INFO level.
 
  Could anyone please help me figure out what I am missing.
  Many thanks,
  Lucas
 
  -
  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




 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org




Re: using a different log4j.properties file per classes directory

2009-07-14 Thread Jacob Kjome


Well, you most certainly shouldn't get DEBUG messages in the R appender 
since the root logger is restricted to the INFO level or higher.  Are you sure 
that Log4j is using the config file you think it is?  Try running with 
-Dlog4j.debug=true to find out.


Jake

On Tue, 14 Jul 2009 10:45:05 -0400
 Lucas Vickers lucasvick...@gmail.com wrote:

Correct I am getting all the DEBUG/INFO/WARN/FATAL from tabs in the root
logger.

I will try setting additivity to false.

thanks :)

On Tue, Jul 14, 2009 at 10:42 AM, Jacob Kjome h...@visi.com wrote:


Are you saying that you get INFO (as well as WARN, ERROR, and FATAL)
logging from the com.tabs logger (and children) in the R appender
associated with the rootLogger?  That's to be expected, as the com.tabs
logger (and children) inherits appenders from parent loggers unless
additivity is set to false.

While you can set...

log4j.additivity.com.tabs=false

...I recommend you simply change your root logger to log at a more strict
level that will log a bit less, such as WARN.  If you want less
restrictive logging for certain things, then you can define those
separately.  This should minimize what gets logged to your R appender and
make it easier to grok.


Jake


On Mon, 13 Jul 2009 22:58:32 -0400
 Lucas Vickers lucasvick...@gmail.com wrote:


I'm using tomcat 5.5.25

I modified the log4j in the commons dir:
common/classes/log4j.properties

and added two seporate logging definitions based on class:

log4j.rootLogger=INFO, R

log4j.category.com.tabs=REBUG, T

in my java code I define the logger as:
Logger log = Logger.getLogger(com.tabs.servlet);

which then causes all the tabs based logging to occur in a separate file
(defined under the T log definition).  The log entries from tabs are
repeated into the root logger, which is not ideal but I can deal with.

Lucas

On Mon, Jul 13, 2009 at 3:54 AM, Jacob Kjome h...@visi.com wrote:

 Work for me.  Different versions require different setups.  5.5 required

log4j.jar
and commons-logging.jar in common/lib.  6.x requries you to manually
rebuild their
custom logging framework to work with Log4j.  By default, it's hard-wired
to JUL.
 So, all that can be considered fishy.  I've never really had an issue
with the
per-app logging when placing log4j.jar in WEB-INF/lib even with another
copy in
common/lib.  What issues have you run into?

Jake

On 7/13/2009 12:30 AM, Yair Ogen wrote:
 log4j under Tomcat is known to be fishy regarding class path.
 Are you sure this suggestion works?

 On Mon, Jul 13, 2009 at 10:27 AM, Jacob Kjome h...@visi.com wrote:

 You have to deploy log4j.jar in both common/lib as well as WEB-INF/lib
of
 each
 app.  Tomcat will use the one in common/lib and each webapp will use
the
 one in
 its respective WEB-INF/lib (because of child-first, or parent-last,
 classloading
 behavior of webapps).

 Jake

 On 7/11/2009 6:01 PM, Lucas Vickers wrote:
 Hello,
 Excuse my simple question as I am new to tomcat/log4j.
 I have looked at the mailing list and did some googling but no luck.

 What I would like to do is have my tomcat installation use one log
file,
 and
 then my own servlet use a different log file.

 ./common/classes/log4j.properties =

 log4j.rootLogger=INFO, R
 log4j.appender.R=org.apache.log4j.RollingFileAppender
 log4j.appender.R.File=${catalina.home}/logs/tomcat.log
 log4j.appender.R.MaxFileSize=100MB
 log4j.appender.R.MaxBackupIndex=50
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

 ./webapps/servlets-examples/WEB-INF/classes/log4j.properties =

 log4j.rootLogger=DEBUG, R
 log4j.appender.R=org.apache.log4j.RollingFileAppender
 log4j.appender.R.File=${catalina.home}/logs/tabs.log
 log4j.appender.R.MaxFileSize=10MB
 log4j.appender.R.MaxBackupIndex=100
 log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

 Ideal result is that my class in /servlets-examples will be in DEBUG
 level
 and will output to the tabs.log

 It appears that my servlet-examples is outputting to tomcat.og and is
in
 INFO level.

 Could anyone please help me figure out what I am missing.
 Many thanks,
 Lucas

 -
 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





-
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: 

DailyRollingFileAppender - creation of directories?

2009-07-14 Thread Andrew Thorburn
I'm fairly sure this isn't possible, but I figured I should check, just in case.

Currently, I have the DRFA set up to roll the log files over at
midnight each day. Nice and simple. However, they all currently wind
up in the same directory, which is not ideal. What I would prefer is
for each month to have a separate directory, so the directory
structure would be like so:

BASEDIR
|2008
|01
|02
|03
.
.
.
|2009
|01
|02
|03
.
.
.
etc.

Just makes it a little easier to find the log file I'm looking for, as
there could easily be hundreds of them. Obviously, if Log4J can't do
this, then I can either live with it or write my own appender.

On a related note, is there any facility in Log4J to have it compress
old log files? I've currently got my own log file archiver (written
outside of Log4J, and tied rather heavily to an in-house application),
but if Log4J provides this facility, I might be better off using that
instead.

Thanks,

- Andrew Thorburn

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: DailyRollingFileAppender - creation of directories?

2009-07-14 Thread Yair Ogen
please look at the extension supplied here:
http://www.simonsite.org.uk

It supports rolling by size and or by date as well as supports archiving.

On Wed, Jul 15, 2009 at 8:11 AM, Andrew Thorburn nzi...@gmail.com wrote:

 I'm fairly sure this isn't possible, but I figured I should check, just in
 case.

 Currently, I have the DRFA set up to roll the log files over at
 midnight each day. Nice and simple. However, they all currently wind
 up in the same directory, which is not ideal. What I would prefer is
 for each month to have a separate directory, so the directory
 structure would be like so:

 BASEDIR
|2008
|01
|02
|03
.
.
.
|2009
|01
|02
|03
.
.
.
 etc.

 Just makes it a little easier to find the log file I'm looking for, as
 there could easily be hundreds of them. Obviously, if Log4J can't do
 this, then I can either live with it or write my own appender.

 On a related note, is there any facility in Log4J to have it compress
 old log files? I've currently got my own log file archiver (written
 outside of Log4J, and tied rather heavily to an in-house application),
 but if Log4J provides this facility, I might be better off using that
 instead.

 Thanks,

 - Andrew Thorburn

 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org