rektide | 18 Jul 18:38
Picon

ALWAYS: Error encountered on logger init:[java.lang.NullPointerException]

No matter what I have in my log4j.properties, I get the following right
after log4j starts:

Error encountered on logger init:[java.lang.NullPointerException]

This is my current log4j.properties file, although I've tried many others:

log4j.rootLogger=FATAL, CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

I dont know how to get any useful information about this failure, and I
cannot discern that I am doing anything wrong.  How can I get information
from log4j about its failure, and how can I debug this issue with log4j?
Thus far I've found no way to get any information on this failure, and it
seems like just having a log4j.properties, whether it has contents or no,
causes this problem.

Here's the output leading to this error:

[log.dir.config] not set - looking in [/home/rektide/foo/conf] for logging
configuration
[/home/rektide/foo/conf/log4j.properties] is a valid file location
[/home/rektide/foo/conf/log4j.properties] is a readable file location
Error encountered on logger init:[java.lang.NullPointerException]

-rektide
m.harig | 18 Jul 07:02
Picon

custom log4j DRFA file name


hi all

    how do i set log file name with timestamp . say for example
logfile_22_05_2008.log  is there any option for this? anyone help me out of
this
--

-- 
View this message in context: http://www.nabble.com/custom-log4j-DRFA-file-name-tp18522700p18522700.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Naina | 17 Jul 22:43
Picon

Implementation of logging

Hello all,

We are currently initiating the process of implementing logging into our
application. We might use either log4j or jdk logging.
We use Weblogic server, so do we need to use *weblogic logging services in
conjunction with either jdk logging or log4j* or do we use them
independently.

Thanks and Regards,
Naina.
Ivan Alencar | 16 Jul 23:32
Picon

Circular Dependency through Appender

Hi,

I've created a log4j appender (by extending AppenderSkeleton) which uses a
component that depends on log4j. Naturally when I set log4j to use this
appender I get a circular dependency, because log4j needs the appender that
needs the component that needs the log4j that needs........... stack
overflow!

Component -----> log4j -----> Appender ----.
    ↑                                      |
    └--------------------------------------'

I can fix that issue just by instructing log4j (set threshold OFF for the
packages that contain logged classes in the component) to ignore the
component's classes that use log4j. Works, but it pollutes and adds
unnecessary complexity to the configuration file, moreover this is risky --
other programmers may not be aware of the circular dependency and will take
ages to figure out what is causing the problem.

To me, changing the logging logic in the component sounds good, but I don't
know exactly how to do that. Is there a way to specify which
appenders appenders used by the Logger instances in the component?

Thanks,
Ivan Z. Alencar
Robert Nicholson | 16 Jul 20:59
Picon

DailyRollingAppender doing strange things with log4j-1.2.14

I'm noticying right now the following situation

-rw-r--r--  1  311170 Jul 16 14:00 name.log

-rw-r--r--  1  455880 Jul 16 14:00 name.log.2008-07-15

 What you should see is that today's log is actively overwriting yesterday's
rolled log.

So yesterdays log is history as it's been overwritten.

Can anybody explain this behaviour and whether a newer version corrects this
problem?
Vishist Mandapaka | 16 Jul 18:34
Picon

log file rolling problem

Hi,
   We're using log4j through commons-logging framework. I'm looking at
a strange behavior where rolling of log files is not happening in
Websphere process server 6.0.2.23 version on Windows 2003/ JDK 1.4.x.
The same log4j configuration is used in Webshere portal, BEA Weblogic
and its working fine. It just with Websphere process server that I see
some strange issue. The application is loading the configuration file,
and the log file format is same as what I configured.
To rule out the possibility of permissions, I've created 10 roll over
files manually in the log directory. Strange thing is, whenever the
log file reaches its maximum size its deleting the roll-over file and
overwriting the same main log file.

I'm pasting log4j configuration here for reference. Any help would be
greatly appreciated.....

# increasing priority levels:  debug, info, warn, error, fatal
#log4j.rootLogger=ERROR, stdout, error
log4j.rootLogger=ERROR, error

# Application console logs
log4j.appender.stdout=org.
apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
#log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c - %m%n

# Debug Log
(Continue reading)

Duseja, Sushil | 16 Jul 15:26
Picon

Logging NDC value

Hello,

I used event.getNDC() to log the NDC value (where event is a
org.apache.log4j.spi.LoggingEvent object), but it's fetching - 'null'.
Similarly, I used event.getThrowableStrRep() to log the exception value
but that is again fetching a null.

Can anyone let me know the correct way of doing the same? Moreover,
please let me know - how to log the MDC value?

Note - I did set the parameter - locationInfo in the log4j.xml.

Thanks.

 
V Jayakumar | 16 Jul 09:28
Picon
Favicon

Configuring Tomcat application's logging


Hello

OS : Linux  + Tomcat 5.5

Logs from my application deployed in Tomcat being written to catalina.out with logging level as DEBUG

I want to change the logging level for my application to ERROR

Created a directory as:

/home/tomcat/webapps/appName/WEB-INF/classes

Had created a log4j.properties 

/home/tomcat/webapps/appName/WEB-INF/classes/log4j.properties 

log4j.rootLogger=ERROR,
Rlog4j.appender.R=org.apache.log4j.RollingFileAppenderlog4j.appender.R.File=/tmp/abcd.loglog4j.appender.R.MaxFileSize=10MBlog4j.appender.R.MaxBackupIndex=10log4j.appender.R.layout=org.apache.log4j.PatternLayoutlog4j.appender.R.layout.ConversionPattern=%p
%t %c - %m%n
Restarted tomcat.

Still, my new changes are not considered and logs from my application is being sent to catalina.out & even
DEBUG messages are being logged.

Could someone let me know, how to configure the logging properties for my application in tomcat, please ?

Thanks

_________________________________________________________________
(Continue reading)

praveen#123 | 15 Jul 19:57
Picon

Missing log entries with DailyRollingFileAppender


Hello everyone,

I have a problem when using the RollingFileAppender: It seems that not 
all log statements get written to the file.
I noticed this, because if I follow the execution of my program (it's 
multithreaded jms and per sec 2 messages are processing  ) and compare it
with the log some logging statements that 
should be written along its path of execution are missing. It's like a() 
calls b() calls c() and the logging outputs from b() are missing. I only 
log with debug level, so it's not a configuration problem. Is there an 
explanation for this strange behavior or a way to fix it? i am using tomcat
5.5 log4j 1.4
this is the log4j file

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
        debug="false">
        <appender name="appLOG"
                class="org.apache.log4j.DailyRollingFileAppender">

                

                

                <layout class="org.apache.log4j.PatternLayout">

                </layout>
        </appender>
        <appender name="appLOG-ASYNC"
class="org.apache.log4j.AsyncAppender">
(Continue reading)

Picon
Favicon

JDBCAppender configuration

Hi everybody,

I am up to build a coocon webapplication, and I am using the 
JDBCAppender for logging. It works quite well. My only problem is, that 
when I switch on the loggin in debug mode, my application is as fast as 
a snail because of the heavy database traffic. How can I solve that? I 
need the debug mode, because on other modes like info or warn no 
interesting log events are logged. I want to log the database actions, 
so that it is possible to monitor all database changes by the 
application. I heard something about filter possibilities, but could not 
find any documentation. Do I need to write my own appender or logger? 
Which tutorial do you suggest?

cheers
Johannes
Duseja, Sushil | 15 Jul 15:41
Picon

Logging - NDC, MDC, PROPERTIES, EXCEPTION

Hello,

Can anyone please let me know as to how can I retrieve - NDC, MDC,
PROPERTIES, EXCEPTION - values from the LoggingEvent object? Do I need
to set any additional parameter (apart from locationInfo) in the
log4j.xml for this?

Any help is appreciated.

Thanks.


Gmane