Wim Deblauwe | 2 Nov 2006 08:25
Picon
Gravatar

RollingFileAppender that zips?

Hi,

is there a rolling file appender that zips the rolled over file? We have
quite big log files. We would like to keep 10 times 10 mb of log files (in
xml format), resulting in 100 Mb of space waisted on people's harddisks. If
the rolled over files would be zipped, then this would dramatically be
smaller. Is this supported by log4j?

regards,

Wim
Dirk Ooms | 2 Nov 2006 09:43

Re: RollingFileAppender that zips?

Yes you can zip files when they are rolled over. Put a '.gz' extension in the FileNamePattern.
Wim Deblauwe | 2 Nov 2006 10:20
Picon
Gravatar

Re: RollingFileAppender that zips?

Thanks for the info. I could not find this in the documentation.

regards,

Wim

2006/11/2, Dirk Ooms <dirk <at> onesparrow.com>:
>
> Yes you can zip files when they are rolled over. Put a '.gz' extension in
> the FileNamePattern.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
> For additional commands, e-mail: log4j-user-help <at> logging.apache.org
>
>
Wim Deblauwe | 2 Nov 2006 10:28
Picon
Gravatar

Re: RollingFileAppender that zips?

Documentation seems to be here:
http://logging.apache.org/log4j/docs/api-1.3/org/apache/log4j/rolling/TimeBasedRollingPolicy.html

But it seems you need to use a time-based rolling policy. Is it possible to
use this with the normal RollingFileAppender? Also, it seems that this is
only added in 1.3, so we will not be able to use it yet (any ideas on
release date?).

regards,

Wim

2006/11/2, Dirk Ooms <dirk <at> onesparrow.com>:
>
> Yes you can zip files when they are rolled over. Put a '.gz' extension in
> the FileNamePattern.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
> For additional commands, e-mail: log4j-user-help <at> logging.apache.org
>
>
James Stauffer | 2 Nov 2006 17:06
Picon

Re: RollingFileAppender Not rolling over

Does it work if you use the standard layout class?

On 11/1/06, vincentw <vincentwong123 <at> yahoo.com> wrote:
>
> Hi, I'm having trouble with thr RFA not rollingover.  Here is my config
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
> debug="false">
>
>   <!-- ==========Appenders========== -->
>   <!-- Define asyncAppender -->
>   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
>         <appender-ref ref="STDOUT"/>
>         <appender-ref ref="R"/>
>   </appender>  <!-- Define R; Rolling file logger -->
>   <appender name="R" class="org.apache.log4j.RollingFileAppender">
>       <param name="File" value="logs/adminlog.txt"/>
>       <param name="MaxFileSize" value="4KB"/>
>       <param name="MaxBackupIndex" value="3"/>
>       <layout class="xxxx.aLayout">
>       </layout>
>   </appender>
>
>
>   <!-- ==========Setup the Root category========== -->
>   <!-- rules for logging DEBUG<INFO<WARN<ERROR<FATAL. -->
>   <root>
(Continue reading)

andresgr | 2 Nov 2006 18:42
Picon

JDBCAppender: it doesn't reconnect, does it?

Hi.

If I have and JDBCAppender configured to throw log messages to MySQL
and, while my system is up I restart the database it does not try to
reconnect to it, does it? So i end up with my logging system
"paralized"...

Regards

--

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-
Andrés González.
http://coyotevil.blogspot.com
sudhakardvvn | 3 Nov 2006 09:39
Picon
Favicon

Logging objects


Hi,
Can we log the java objects(seriablizble) into a logfile using log4j? If yes
please tell me some good link or example on this one.
Thanks in Advance
Sudhakar
--

-- 
View this message in context: http://www.nabble.com/Logging-objects-tf2566625.html#a7153706
Sent from the Log4j - Users mailing list archive at Nabble.com.
Patrick Wyss | 3 Nov 2006 11:18
Picon

AW: Logging objects

you can log anything with log4j :-]

depending on what you want to do you can use one of the following
json:
http://www.json.org
or xstream:
http://xstream.codehaus.org/index.html

and either change your log requests:
log.debug( xstream.toXML(someObject));
or
write your own Layout

regards
patrick

> -----Ursprüngliche Nachricht-----
> Von: sudhakardvvn [mailto:dvvn_sudha <at> yahoo.com]
> Gesendet: Freitag, 3. November 2006 09:40
> An: log4j-user <at> logging.apache.org
> Betreff: Logging objects
> 
> 
> 
> Hi,
> Can we log the java objects(seriablizble) into a logfile 
> using log4j? If yes
> please tell me some good link or example on this one.
> Thanks in Advance
> Sudhakar
(Continue reading)

Scott Deboy | 3 Nov 2006 14:27

RE: Logging objects

In log4j 1.3 there is a ReflectionFilter that will use an object's 'toString' method as the message.  It then
creates logging event properties out of any of your object's JavaBeans-style properties before the
logging event is passed on to appenders.

It may be possible for you to backport it.

You could also write your own renderer instead - if you're looking to serialize only a single class or a few
classes. 

Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR  97201

Telephone:      503.224.7496
Cell:           503.997.1367
Fax:            503.222.0185

sdeboy <at> comotivsystems.com

www.comotivsystems.com

-----Original Message-----
From: sudhakardvvn [mailto:dvvn_sudha <at> yahoo.com]
Sent: Fri 11/3/2006 12:39 AM
To: log4j-user <at> logging.apache.org
Subject: Logging objects

Hi,
Can we log the java objects(seriablizble) into a logfile using log4j? If yes
(Continue reading)

shy guy | 3 Nov 2006 18:15
Picon

Nullpointer !

I am using NullpointerException while logging error with log4j 1.2.14
hundreds of lines are printed in the log and console, before this error
occurs, so file configuration must be write
I m using it from inside RAD 6.0
logging line looks like

  catch (ISPSvcException ise) {
  ->  logger.error("errrr", ise);

Exception in thread "main" java.lang.NullPointerException

at java.io.Writer.write(Writer.java:144)

at org.apache.log4j.helpers.QuietWriter.write(QuietWriter.java:47)

at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:308)

at org.apache.log4j.WriterAppender.append(WriterAppender.java:159)

at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)

at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(
AppenderAttachableImpl.java:65)

at org.apache.log4j.Category.callAppenders(Category.java:203)

at org.apache.log4j.Category.forcedLog(Category.java:388)

at org.apache.log4j.Category.error(Category.java:319)

(Continue reading)


Gmane