rodchar | 2 Mar 2009 18:30
Picon
Favicon

xmllayoutschemalog4j help


hey all,

is it possible to customize what xmllayoutschemalog4j outputs?

thanks,
rodchar
--

-- 
View this message in context: http://www.nabble.com/xmllayoutschemalog4j-help-tp22292525p22292525.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Gunnar.Bostrom | 3 Mar 2009 13:42
Favicon

Log4j AsyncAppender does not log stack trace

Hi,
I use log4j version 1.2.14 and the async appender. It works fine but
this morning I noticed a strange behavior.
We experienced some (about 10) NullPointerExceptions after midnight
This statement: logger.error("RemoteResult caught exception", e);
logged the exception and a stack trace as expected.

After 7 AM we got some more (about 10 again) NullPointerExceptions but
now we only got the message and no stack trace!

The appender is configured with a buffer size of 5000 and blocking set
to true.
I don't think that the load is so high that the buffer has been filled
up.

What can be wrong?

Thanks
/Gunnar
Mohit Anchlia | 3 Mar 2009 21:19
Picon

timestamp in rolled over files

Is there a way to get the timestamp instead of .1 .2 etc. when a log
file is rolled over by log4j?
Simon Park | 3 Mar 2009 22:09
Picon
Favicon

Re: timestamp in rolled over files

You could maybe use the org.apache.log4j.DailyRollingFileAppender to roll by time only.  You use a
pattern compatible with java.text.SimpleDateFormat to configure the appender's DatePattern
property with the period you want files to roll, e.g. by any one of minute, hour, half-day, day, week, etc.

________________________________
From: Mohit Anchlia <mohitanchlia <at> gmail.com>
To: log4j-user <at> logging.apache.org
Sent: Tuesday, 3 March, 2009 20:19:10
Subject: timestamp in rolled over files

Is there a way to get the timestamp instead of .1 .2 etc. when a log
file is rolled over by log4j?

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
For additional commands, e-mail: log4j-user-help <at> logging.apache.org

      
Mohit Anchlia | 3 Mar 2009 23:59
Picon

Re: timestamp in rolled over files

Do you have an example of that? I couldn't find it.

On Tue, Mar 3, 2009 at 1:09 PM, Simon Park <simon_park_mail <at> yahoo.co.uk> wrote:
> You could maybe use the org.apache.log4j.DailyRollingFileAppender to roll by time only.  You use a
pattern compatible with java.text.SimpleDateFormat to configure the appender's DatePattern
property with the period you want files to roll, e.g. by any one of minute, hour, half-day, day, week, etc.
>
>
>
>
> ________________________________
> From: Mohit Anchlia <mohitanchlia <at> gmail.com>
> To: log4j-user <at> logging.apache.org
> Sent: Tuesday, 3 March, 2009 20:19:10
> Subject: timestamp in rolled over files
>
> Is there a way to get the timestamp instead of .1 .2 etc. when a log
> file is rolled over by log4j?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
> For additional commands, e-mail: log4j-user-help <at> logging.apache.org
>
>
>
Agustín | 4 Mar 2009 17:48
Picon

Is it possible several web servers writing in the same log file?


Hi there! I have the following question:

Two linux machines with the same web application work together in "load
balance" configuration. Could I have the same log file for the two servers?
The first idea is mount by NFS the same directory in both machines and put
there the log files, but I'm not sure if this is reliable because we would
have two JVM trying to write in the same rolling file. Any ideas would be
apreciated. 

Regards,
Agustín T.
--

-- 
View this message in context: http://www.nabble.com/Is-it-possible-several-web-servers-writing-in-the-same-log-file--tp22334114p22334114.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Chance Yeoman | 5 Mar 2009 18:27
Favicon

Separating Configuration


Hi,

I am working on a log4j implementation of the http request logger for Jetty 6.1.7 and I had a question about
the best practice for separating logger configurations and hierarchies.  I would like to line
configuration up with current Jetty config as much as possible.  This would mean one default logger
configured from a single config file and the ability to create any number of new loggers on a context basis
that could be configured from their own files.  What's the best way to keep these configurations separate
and local to the server's http request logging mechanism?  Should I create a LoggerFactory that maintains
it's own LoggerRepository just for the request loggers?

Thanks,

Chance

--
Center for the Application of Information Technologies
Ceki Gulcu | 5 Mar 2009 18:39
Picon
Gravatar

Re: Separating Configuration

Hello,

Given that log4j is not designed for access logging, are you really
able to do access logging with log4j?

Chance Yeoman wrote:

 > I am working on a log4j implementation of the http request logger for
 > Jetty 6.1.7 and I had a question about the best practice for
 > separating logger configurations and hierarchies.  I would like to
 > line configuration up with current Jetty config as much as possible.
 > This would mean one default logger configured from a single config
 > file and the ability to create any number of new loggers on a context
 > basis that could be configured from their own files.  What's the best
 > way to keep these configurations separate and local to the server's
 > http request logging mechanism?  Should I create a LoggerFactory that
 > maintains it's own LoggerRepository just for the request loggers?

--

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
Chance Yeoman | 5 Mar 2009 20:17
Favicon

Re: Separating Configuration


Yes, a replacement implementation of Jetty's RequestLog interface can be made to construct the access log
message in the same format as usual, but to log to a logger rather than directly to a file.  This part of the
mechanism has already been implemented.  The contents of the logged message are not configurable from
within the log4j configuration file, but from the RequestLog properties or by hard coding them.  In fact,
most of the logger configuration would be configured (or even overridden) upon RequestLog
instantiation.  

The benefit of using log4j is the ability to use appenders.  For example, a default file appender with
threshold ALL could send all messages to a rotating file, and a JDBC appender could be used for all ERROR
level messages (which may have been configured from the RequestLog implementation to be any request that
received a 500 level response).  In a clustered environment, the addition of a Socket appender could help
with log consolidation.  

I would want to configure each of these loggers from its own log4j configuration file and kept separate from
any other configuration that other components may be using.  My experience with Log4J is limited so I may be
incorrect, but it looks like the static methods usually used to configure and retrieve loggers operate on
a classloader-wide basis.  I am hoping to localize Logger configuration and access to within an
individual RequestLog instance.

Would it be better to make an extension of Logger and a specialized Configurator that only reads appender information?

--
Center for the Application of Information Technologies

----- Original Message -----
From: "Ceki Gulcu" <ceki <at> qos.ch>
To: "Log4J Users List" <log4j-user <at> logging.apache.org>
Sent: Thursday, March 5, 2009 11:39:55 AM GMT -06:00 US/Canada Central
Subject: Re: Separating Configuration
(Continue reading)

Vogtländer, Arend (bos | 6 Mar 2009 14:40
Picon
Favicon

strange behaviour of log4j

Dear Sir or Madam,

we have monitored a quite strage effect in log4j logfiles, which are
produced on a JBoss applicationserver of one of our customers.

I tried to google about it, but couldn´t find any hint, that somebody ever
had the same problem, this is why i come to ask you about it.

the effect ist as follows: 

the logfiles start with a line of nullvalues (0x00). this line is sometimes
a large ammounts of screenpages long. 

It seems that there ist a nullvalue pushed to the beginning of the logfile
every some time.

E.g. today we had a logifle with a size of ~50MB content.

anyway there were only 69 Lines of entries, and a preceeding line with
50663124 "00" - Bytes.

We got the file zipped, and i would say, it has a phenomenal
compressionrate: the original size is 50.674.628 Bytes and compressed it has
50.478 Bytes. That comes to a Factor of ~1000, wow ;-)

Anyway, as we have no other customer, who has a similar problem, and there
seems to be nobody else having such a problem, I´d be very happy for a short
estimation, where I could have a look to find a cause for the effect.

The OS is a SuSE10, Applicationserver is JBoss 4.2.2, and the Log4j Version
(Continue reading)


Gmane