Does log4j reconfigure only if there is a change in the config file
Yes, the watch period only specifies how often to check for changes
The main pitfall is non-terminated threads. Especially if you utilize
hot-redeployment; when hot-redeploying, weblogic will not be able to
terminate the
What you want is:
log4j.rootLogger=DEBUG, A1, A2
log4j.appender.A1=org.apache.log4j.ConsoleAppender
...
log4j.appender.A2=NTEventLogger
log4j.appender.A2.threshold=ERROR
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Whats the standard way to setup logging in an app server when some
components use a properties file for config and some use an xml file?
Previously we had control of all deployed components on thats server, and
all the components used a file named log4j-config.xml located on the various
developing components that are under the same adminstrative control as you
(i.e. contractors or developers working for the same organization) then
everyone needs to get on the same page regarding logging.
-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Wednesday
Why not have the admins modify the container's startup scripting so that
some token system property gets set, and then reference that in your log4j
config using variable substitution.
For example, in my weblogic startup script I add a system property
-Dappname.log.dir=/some/dir to the java
. Does this mean
its not finding the properties file?
To answer the other questions, this is a Struts application, and I'm in an
Action class in the war file. I haven't gotten to logging in the EJB jar
file yet.
-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent
common error handling component is based on log4j. I'm going to
have to do some work with our server guys on this one. Thanks for your
help.
-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 8:50 AM
To: 'Log4J Users List'
Subject: RE: Picking
Try setting the System property log4j.debug to true; typically this is
done using -Dlog4j.debug=true. The other option would be to slightly alter
the main as follows:
public static void main( String[] args )
{
System.setProperty( log4j.debug, true );
try
{
Is that directory on the classpath somewhere higher than the weblogic app
classloader? For example is it on the system classpath or server classpath?
Where is the class which triggers log4j initialization? Is it contain
within the war file? If, for example, and ejb component is the first to
Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 30 July 2003 19:16
To: 'Log4J Users List'
Subject: RE: newbie: configuring log4j for EJB's inside weblogic
I've done two seperate setups for configuring log4j on weblogic (both
are
6.1sp4).
#1 log4j.jar and its config
I've done two seperate setups for configuring log4j on weblogic (both are
6.1sp4).
#1 log4j.jar and its config file on the server classpath (i.e., the
classpath built in startWebLogic.sh)
#2 Each enterprise deployable handling its own config. In my ear, this is
accomplished by including a war
Use the getLocationInformation() method on LoggingEvent prior to
serializing...
-Original Message-
From: Sanjay Gupta (sanjaygu) [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 10:37 AM
To: 'Steve Ebersole'; 'Log4J Users List'
Subject: RE: Serialization of LoggingEvent message
The EJB specification says that an EJB should not
perform file I/O.
Partially true... The spirit of this restriction is that a j2ee app should
not use the io package for business data. The reasoning is simple, io
access is generally not transactional. Most people would not consider logs
under
log4j.rootLogger=INFO,FILE
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=./log.txt
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%p -%m%n
Will create a file named log.txt in the current working directory (the
still get output to the screen (standard out?) as
well. Is there a way to prevent this?
Neil
-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 12:07 PM
To: 'Log4J Users List'
Subject: RE: Newbie Question
log4j.rootLogger=INFO,FILE
Standalone. Just part of a java app.
-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 12:20 PM
To: 'Log4J Users List'
Subject: RE: Newbie Question
You should not be. In what type of environment is this running? In Tomcat?
In an app-server
-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 12:25 PM
To: 'Log4J Users List'
Subject: RE: Newbie Question
How are you doing the initialization of log4j?
Are you possibly using jakarta-commons-logging or using something that uses
it?
-Original Message
=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%p -%m%n
-Original Message-
From: Ebersole, Steven
Sent: Friday, July 11, 2003 1:08 PM
To: 'Log4J Users List'
Subject: RE: Newbie Question
You say just part of a java app... Some other part of that app must be
doing
I do not use Tomcat, but if I remember correctly Tomcat itself defines a
root logger programatically and redirects stdout to that logger.
Try setting the additivity for your logger to false, which would stop
messages sent to your logger from also being handled by other loggers higher
in its
You could simply utilize serialization to perform this. Here is a code
snippet I have in a utility class:
public static Object deepCopy( Object incoming )
throws java.io.IOException
{
try
{
// Serialize the incoming out to memory
that LoggingEvent will ever
be updated to support cloneable?
Damian.
Ebersole, Steven wrote:
You could simply utilize serialization to perform this. Here is a code
snippet I have in a utility class:
public static Object deepCopy( Object incoming )
throws java.io.IOException
The file is set to C:Log4jTestLog4jTesterWebContentexample.log
look in your c: dir for this file...
You are using incorrect directory seperator. You either need to specify:
1) C:\\Log4jTest\\Log4jTester\\WebContent\\example.log
2) C:/Log4jTest/Log4jTester/WebContent/example.log
My set up is that weblogic (6.1sp3) is being run in development mode. I
have an EAR deployment and then a web app deployed in expanded directory
format. In weblogic, this setup is nice for development because it lets me
move class files out to the web-app without having to restart the server for
P.S. The web-app was initially deployed (and still is on staging and
production environments) in WAR format. There was no problem with that set
up...
-Original Message-
From: Ebersole, Steven
Sent: Thursday, June 12, 2003 9:53 AM
To: Log4j user list (E-mail)
Subject
Its a custom package we wrote to maintain logins between different apps
within weblogic. Here it basically binds sessions between the web-app and
the EAR file.
Do you think changing configureAndWatch() to simply configure() would have
any effect?
-Original Message-
From: Ceki Gülcü
In props:
##
log4j.rootLogger=DEBUG,appender1
log4j.logger.specificLogger1=DEBUG,appender2
log4j.logger.specificLogger2=DEBUG,appender3
log4j.appender.appender1=...
log4j.appender.appender2=...
log4j.appender.appender3=...
In XML:
com.foo.
log4j.logger.SYSTEM=DEBUG
log4j.logger.AUDIT=DEBUG
log4j.logger.TRANSACTION=DEBUG
On Wed, 2003-06-11 at 16:29, Ebersole, Steven wrote:
What's your config look like?
-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday
Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 6:45 PM
To: Log4J Users List
Subject: RE: Duplicate Triggering of custom appender.
to SYSTEM, AUDIT and TRANSACTION
On Wed, 2003-06-11 at 16:41, Ebersole, Steven wrote:
To which loggers
On Wed, 2003-06-11 at 16:54, Ebersole, Steven wrote:
Try the following just to see if you still get the same issue (and do
_not_
programatically add the appender):
##
# Define loggers
something for failover support, like maybe using
an error handler to failover the JMS destination.
HTH
|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
|Sent: Friday, April 04, 2003 8:47 AM
|To: 'Log4J Users List'
|Subject: RE: log4j in clustered
One approach would be to define an appender using a
org.apache.log4j.varia.LevelMatchFilter set to INFO for the cumul.log file.
This assumes you are either using an XML config, or programtically
configuring log4j (as the property file config does not recoginize filters).
The exact details of how
The old property file syntax in log4j used to be:
log4j.category.A.B.C.D=...
As Yoav states, it appears by their use of the Category class that the
lo4jme project may be using that (much) older setup. You might want to try
out the older syntax in the property file.
If your doing Ant builds,
. Unfortunately we now get a
|illigalAccessException only non-native method can be invoked
|When trying to instantiate the File appender.
|
|Any ideas?
|
|
|
|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
|Sent: Wednesday, March 12
me where the site is? thanks!
|
|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
|Sent: Wednesday, March 12, 2003 2:18 PM
|To: 'Log4J Users List'
|Subject: RE: Log4jme
|
|
|unsubscribe from this mailing list on the Apache Jakarta site
Just to clarify, I'm not sure how your properties file can be getting huge
if you have only defined:
log4j.rootLogger=DEBUG, daily
log4j.appender.daily=org.apache.log4j.DailyRollingFileAppender
Is it just getting huge because you added all the additivity flags?
As for setting additivity
I use log4j in weblogic (6.1.3). Not sure what you mean by handy
resource.
Also, not at all sure what you mean by direct it to the properties file.
If you mean set up the environment such that log4j can initialize itself, of
course you can. There are two options (neither of which is weblogic or
Just to make sure I understand:
The statement is completely correct when going to LightSpeed_Default
appender; but then everything going to the LightSpeed_Console appender
displays the characteristics you mention? Is it every message that you log
to the console appender?
If so, my guess is that
Actually, this should be really easy to test, now that I thought about it
further. What happens if you add a System.out.println() call? Does it show
up with the same INFO marking?
|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, March 04
.
|
|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, March 04, 2003 9:57 AM
|To: 'Log4J Users List'
|Subject: RE: Help with Logging (1.2.7)
|
|Actually, this should be really easy to test, now that I
|thought about
|defined by the JBOSS
|installation. I need this because we deploy on multiple
|platforms of which
|I cannot guarantee they will be using log4J for their
|application server
|logging.
|
|
|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL
You could switch to an XML config file and use ENTITY includes to include a
file containing your global settings.
Another option would be to use variable replacement in each of your seperate
configs. Something like log4j.logger.org.apache=${ORG_APACHE_LOG_LEVEL};
then set ORG_APACHE_LOG_LEVEL as
As for the grouping, that is just not feasible in any sort of multi-threaded
environment. Messages are logged in the order in which the happen.
As for the other issue, I have seen this before, but in every instance I was
simply a matter of code not _PROPERLY_ cleaning up the NDC. For
I'd be willing to try them out. I have been planning on doing something
similiar for session and request level trace logging in some web apps.
|-Original Message-
|From: Mark Womack [mailto:[EMAIL PROTECTED]]
|Sent: Friday, February 07, 2003 12:46 PM
|To: 'Log4J Users
., log variable is null! I have defined
|
|private transient Category log = Category.getInstance(getClass());
|
|in the EmployeeVO.
|
|Thanks,
|Sandeep
|
|
|--
|From: Ebersole, Steven
|Sent: Wednesday, February 05, 2003 4:48 PM
So do one of the following:
1)
public class EmployeeVO implements java.io.Serializable
{
private static Category log = Category.getInstance( getClass() );
...
public getName()
{
try
{
...
}
catch(Exception e)
{
Sorry, actuall option #1 would need to be:
private static Category log = Category.getInstance( EmployeeVO.class );
instead...
|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
|Sent: Thursday, February 06, 2003 11:54 AM
|To: 'Log4J Users List
It looks like maybe you are trying to define a Logger as a variable on
something which is getting serialized. Logger does not implement the
Serializable interface. You must mark that Logger variable as transient, or
explicitly read and write it yourself during serialization.
|
|
|
|--
|From: Ebersole, Steven
|Sent: Wednesday, February 05, 2003 3:28 PM
|To:'Log4J Users List'
|Subject: RE: log4j + j2ee error
|
|It looks like maybe you are trying to define a Logger as a
|variable on
|something which
The syntax you want is: %3.3p
|-Original Message-
|From: Daniel Serodio [mailto:[EMAIL PROTECTED]]
|Sent: Monday, February 03, 2003 10:17 AM
|To: Log4J Users List
|Subject: RE: How to truncate characters in the layout of priority
|
|
|Actually, no. I
Sorry, don't know what to tell you then. I works fine for me both from
within NetBeans (my IDE of choice) as well as from various command line
scenarios (and I do not have to give a directory, just a path relative from
the classpath).
Sorry, I'm just not familiar enough with those IDEs you
So to make sure I understand correctly:
xx_log4j.properties is a file in some directory which you have defined to
your IDE as being part of the classpath? Correct?
There are a number of ways to get log4j to be able to read this file in
order to configure itself:
1) Simply rename the file from
Where do you keep the config file? Is it also in the ear? Or is it in some
path which is defined during server startup? If the latter, than that will
cause you problems.
Where is the log4j jar file? That must also be in each ear file for this to
work correctly.
Also, if you use classes which
additivity is an attribute of the logger/category, not the appender...
As such, instead of:
log4j.category.com.printrak.me4=DEBUG, R4
log4j.additivity.R4=false
you want:
log4j.category.com.printrak.me4=DEBUG, R4
log4j.aditivity.com.printrak.me4=false
|-Original
Step-by-step what is happening here is:
First-call:
1) A logger with a name matching the given class_name does not exist, so
log4j creates it.
2) Two appenders are added to the logger (a console appender and a file
appender).
Second-call:
1) A logger with a name matching the given class name
.
|
|But with a config file, we can't change easily this
|parameters, we have to
|deploy the ear, make the modification
|and then rebuild the ear !
|
|Thx a lot for your help.
|
|
| -Message d'origine-
| De : Ebersole, Steven [mailto:[EMAIL PROTECTED
The configs are maintained per-LoggerRepository. The scope of this depends
on the RepositorySelector implementation that you are using. The default
selector uses classloaders as its scoping mechanism, and thus does work with
the way you want in servlet containers which use seperate classloaders
Not sure if this was just a typo, but
log4j.logging.com.sel.CxLoggingAdapter is probably not what you want...
You probably were thinking log4j.logger.com.sel.CxLoggingAdapter, such
that the relevent part of the config would look like:
log4j.rootLogger=DEBUG,A2
Are you passing it the initialContextFactoryName and providerURL properties?
Or is the JMSAppender picking these up from the System?
Basically, the JMSAppender is trying to initialize itself with an
IniitalContext from the URL t3://localhost:8080. Does this appender run
on the same physical box
There are other messaging systems other than J2EE app servers which support
JMS API. For example, IBM's MQ Series has a JMS API.
Is there a particular messaging system you are trying to feed using the
appender?
There are a couple of open-source JMS messaging servers also...
So,no you do not
We use JMS-based logging now, but initially used file-appender logging in
our tests about a year ago. Thats a long stretch for my brain, but I seem
to recall not having to make any config changes to weblogic.
Have you tried with you current weblogic setup (sans any changes)? What was
the error
did some
|search over the internet and it seems like log4j has
|problem loging stuff
|under wl6.1 and solaris OS according to several findings.
|What's your OS?
|
|Thanks,
|
|Yi
|
|
|-Original Message-
|From: Ebersole, Steven [mailto:[EMAIL
I use log4j along with weblogic (6.1 through 6.1 sp3) with no problems.
I too, have log4j.properties on the WL server classpath (as well as the
log4j.jar file). Where is your log4j.jar file? Are you using any other
components which might be using log4j(there are quite a few libraries
nowadays
Actually we ran into this same issue on our weblogic deployment. It is
because requests are handled by threads retrieved from a thread pool.
However, the real reason for this bleed was that NDC.pop() was not always
being called. Make sure NDC.pop() and NDC.remove() are done in a finally
blocks
JMSAppender opens its session to the JMS server in AUTO_ACKNOWLEDGE,
non-transacted mode. Basically, this means the message should be
delivered no matter what. So the JMSAppender is already set up to operate
outside of currently running transactions.
How are you processing the messages from
|-Original Message-
|From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
|Sent: Friday, September 06, 2002 8:02 AM
|To: Log4J Users List
|Subject: Re: JMSAppender in Container Managed Transactions
|
|
|
|What is your architecture? Which App Server are you
|-Original Message-
|From: Cakalic, James [mailto:[EMAIL PROTECTED]]
|Sent: Friday, September 06, 2002 8:24 AM
|To: Log4J Users List
|Subject: RE: JMSAppender in Container Managed Transactions
|
|
|As you say, the problem is on the producer side. I think
I have nearly the same exact setup, except that:
1) I am still on WL 6.1;
2) I use a custom log4j appender which logs to a queue instead of a topic
I did have a little bit of issues getting the message-driven beans to work
(not just the logging consumer, but other processes also). WebLogic was
I am sure that it works for me. ;0)
Yes, I have session beans which are marked to let WebLogic manage its
transactions as Required. If something should go wrong in one of them, I
send a log message with the underlying exception, throw a custom exception,
and set the transaction for rollback
SPECIFICALLY:
As Ceki mentioned you currently have logging statements being output to both
files... this will hurt performance in this test. Simply setting
additivity to false for the two loggers should work wonders for this simple
test. Try this for your config:
We actually handle this by:
1) having log4j configured to use the ConsoleAppender;
2) piping/directing output from the shell script (including the console
output from log4j) into a file.
Works pretty well.
|-Original Message-
|From: Steve Cohen [mailto:[EMAIL PROTECTED]]
I almost, forgot...
I havent tried it yet, but I remember that an open source project just
released log4perl not too long ago. You might want to have a look at a
solution using that.
HTH
|-Original Message-
|From: Steve Cohen [mailto:[EMAIL PROTECTED]]
|Sent: Wednesday,
-
|From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
|Sent: 30 August 2002 17:51
|To: 'Log4J Users List'
|Subject: RE: NB 3.2.2 JBoss 3.0.0 Log4J ...
|
|
|Are you running the JBoss source in debugger?
|
|What, if anything, does display in output console
All this is explicitly in the docs. You may want to start by taking a look
there B4 posting questions. The docs for this project are very good.
http://jakarta.apache.org/log4j/docs/documentation.html
Below is the snippet from the docs describing log4j initialization:
The exact default
Our enterprise-app setup is a bit different, but we configure log4j per WLS
server instance. A JMS queue then serves as the logging destination for
that server.
In the start-up script (startWebLogic.sh) we add the -Dlog4j.configuration=?
to the start command, where ? points to the config for
Output destinations are handled by Appenders, not Loggers. In particualr,
file destinations are handled by FileAppender and its subslasses.
Programtically, you can do something like:
Logger logger = ...;
logger.removeAllAppenders();
FileAppender appender = new FileAppender();
NB 3.2.2 = NetBeans 3.2.2
How are you connecting to the JBoss instance for debugging? Is anything
appearing in you output console? Where is your log4j property file
directing output?
|-Original Message-
|From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
|Sent: Friday, August
Logger, conceptually, should not be Serializable.
You can mark the Logger fields in those dataObjects as transient, but then
when the session reactivates the field would be null; you'll have to write
logic to handle the session activating to (re)obtain the Logger instance.
This can be done
Message-
|From: sanjayrajsoni [mailto:[EMAIL PROTECTED]]
|Sent: Monday, August 26, 2002 2:22 PM
|To: [EMAIL PROTECTED]
|Subject: Re: creating log file for each user
|
|
|Do you have any clustering Issues with your MDB's?
|
|--- In [EMAIL PROTECTED], Ebersole
Is notification.log really used as configuration file? If so, this might
cause problems because the redirector will truncate that file prior to
appending to it, and so the file maybe empty when log4j attempts to read it
to configure itself.
If, instead, notification.log is just referenced in
The commands you are using are weblogic-specific as you are using the
weblogic.Admin tool. If you wish to keep using the weblogic-proprietary
methods, then check out their E-Docs site. Specifically,
http://e-docs.bea.com/wls/docs61/adminguide/cli.html#1155716 will show you
how to configure
://www.vignette.com
|-Original Message-
|From: Ebersole, Steven
|Sent: Wednesday, July 10, 2002 2:24 PM
|To: 'Log4J Users List'
|Subject: RE: Can't control logging via root - get all msgs despite
|setting priority
|
|
|Did you set the additivity flag
See inline...
|-Original Message-
|From: rayaku [mailto:[EMAIL PROTECTED]]
|Sent: Thursday, March 07, 2002 10:25 PM
|To: Log4J Users List
|Cc: [EMAIL PROTECTED]
|Subject: 3 basic questions
|
|
|
|Hi,
|I found info is very clear, But I would like to know
|1. where to find the keys and
Yes it can output this type of information. It is called LocationInfo in
log4j.
It is not tied to the Logger class per se. It is really a function of the
various layouts (some of which support printing this info, some of which do
not).
PatternLayout does support this through its different
I do this exact same thing through JMS logging. I have a User object which
acquires a per-instance Logger by doing : Logger.getLogger( session. +
getUserName() ).
In my config I then have an explicit entry for session which pushes out to
the appropriate JMS destination. There is then a
-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 11:22 AM
To: Log4j user list (E-mail)
Subject: LocationInfo bug
There is a real subtle bug in LocationInfo which can cause log4j itself to
skip stack frames.
It has to do with how the stack trace is searched
I know all the arguments about obtaining LocationInfo being slow.
That being said, I am looking at using wrapper classes around log4j
Loggers (sort of similiar to what jakarta commons does). We find the
LocationInfo invaluable in most logging cases for their debug/investagation
value.
);
}
...
}
Then it should generate the correct location info.
hope it helps,
-Mark
-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 10:20 AM
To: 'Log4J Users List'
Subject: LocationInfo and Logging wrappers
I know all the arguments
87 matches
Mail list logo