RE: ConfigureAndWatch (Add-on)

2003-09-11 Thread Ebersole, Steven
 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 thread started from the last deployment and it will run until
you stop the server.  Plus thread generation from within a j2ee container is
dis-allowed by the j2ee spec.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Filtering based on Appender

2003-09-03 Thread Ebersole, Steven
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 additional commands, e-mail: [EMAIL PROTECTED]



Config in app server envs

2003-08-27 Thread Ebersole, Steven
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
classpaths.  The only way I had found to acheive this was to set a
-Dlog4j.configuration=log4j-config.xml system property.  That worked OK,
until now.  Now there is a new component in the mix which attempts to use a
properties file, but fails to iniitialize because of the log4j.configuration
system property being set.

How can I make this work, short of converting the third party properties
file into its XML representation.

Also, is there a way (or plans for a way) to make a standard naming for the
XML configs?  Such that default init attempts to find log4j.properties, and
then log4j.xml (or some other name)...


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Config in app server envs

2003-08-27 Thread Ebersole, Steven
That is pretty much what we are trying.  It was working up until installing
this new component.  Unfortunately, this new component uses what appears to
be a custom logger wrapper which, no matter what we try, just does not
utilize the existing current log4j init.


-Original Message-
From: Sullivan, Sean C - MWT [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 5:04 PM
To: 'Log4J Users List'
Subject: RE: Config in app server envs



Our situation:

- Log4j 1.2.8
- two application servers in our cluster
- five EAR's

We use a single log4j.xml for all of our applications.

log4j.xml is stored on the server's filesystem.

We set JVM system property (log4j.configuration) so that 
Log4j can find our log4j.xml file

-Sean


 -Original Message-
 From: Charles Hudak [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, August 27, 2003 1:01 PM
 To: 'Log4J Users List'
 Subject: RE: Config in app server envs
 
 There are obviously many ways to do this.
 
 The way I do it is I created a LogInitializer servlet that is loaded on
 startup and uses a single configuration file. Since I'm really only
 concerned about the logging from MY code and not any of the open
 source/other components that I have installed, this works fine.
 
 The nice thing about this is I have written the servlet so that it can be
 called in order to 'refresh' the logging properties if I need to change
 them
 on the fly. Since we have clustered servers, this servlet invokes the
 refresh on each of the servers in the farm to re-initialized their logging
 as well.
 
 Logging setup should NEVER be done by component writers (IMHO) unless the
 component is standalone. Rather, they should provide logging in the code
 that can be turned on and configured by the app deployer. If you have
 groups
 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, August 27, 2003 12:51
 To: Log4j user list (E-mail)
 Subject: Config in app server envs
 
 
 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
 classpaths.  The only way I had found to acheive this was to set a
 -Dlog4j.configuration=log4j-config.xml system property.  That worked OK,
 until now.  Now there is a new component in the mix which attempts to use
 a
 properties file, but fails to iniitialize because of the
 log4j.configuration
 system property being set.
 
 How can I make this work, short of converting the third party properties
 file into its XML representation.
 
 Also, is there a way (or plans for a way) to make a standard naming for
 the
 XML configs?  Such that default init attempts to find log4j.properties,
 and
 then log4j.xml (or some other name)...
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Creating log files relative to the web applications root directory?

2003-08-14 Thread Ebersole, Steven
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 command starting weblogic.  We have
multiple apps running, so the appname part of appname.log.dir is specific to
each app.  Then in my log4j.xml file, I use:

appender name=file1
class=org.apache.log4j.DailyRollingFileAppender
param name=file value=${appname.log.dir}/app_log.txt/
...


 Another issue we have is that most of the development work is done on a
Windows
 based machine and the production servers are hosted on a flavor of Unix
I use windows for development/local-testing and then deploy onto Solaris
boxes for dev/staging/prod, so I have the same setup.  Hardcoding C:/...
will of course blow up on unix jvms, however, using /... will actually work
on windows boxes.  Windows jvms interpret this to mean root of the current
volume, which typically is equivalent to the root of the C-drive.



-Original Message-
From: Adrian Beech [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 13, 2003 5:35 AM
To: 'Log4J Users List'
Subject: RE: Creating log files relative to the web applications root
directory?


G'day,

U, so basically then it is not possible to define a directory path in
the log4j.xml properties file so that log files are placed relative to the
web apps root directory?  Or for that matter relative to any known anchor
point like the server root directory?

A problem we have is that we deploy .war files by sending the package to the
server gods who then drop it into the webapps directory.  Alas we don't have
the rights to deploy directly to the server environment and tools like ANT
whilst are good at building a distributable archive they do not quite make
the grade when resolving tokens in a dynamic style of deployment.  Another
issue we have is that most of the development work is done on a Windows
based machine and the production servers are hosted on a flavor of Unix.
Hard coding a directory path like C:\..\ may work when doing the dev work
under Windows but just don't kind of cut it on a Unix file system when it
comes time to deployment.  

BTW, the last time I looked me was male so I'll opt out for king!

AB

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: Monday, 11 August 2003 11:14 PM
To: Log4J Users List
Subject: RE: Creating log files relative to the web applications root
directory?



Howdy,
I suppose Adrian could be a woman's name as well, so you're right ;)

AmendedVersion
But if you're the server admin, you're king (or queen) ;) /AmendedVersion

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Caroline Wood [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 9:13 AM
To: 'Log4J Users List'
Subject: RE: Creating log files relative to the web applications root 
directory?

or Queen! lol ;)

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 11 August 2003 14:05
To: Log4J Users List; [EMAIL PROTECTED]
Subject: RE: Creating log files relative to the web applications root 
directory?



Howdy,
What I've seen done to achieve this is have my ant deployment script 
fill the value when copying log4j.xml over.  So in log4j.xml, you'd
have

param name=File value=@logFilePath@ /

And in your ant script, you set filtering=true when copying
log4j.xml,
and replac the logFilePath token with the actual (absolute) path.

As an aside, note that the servlet container is not required to give
you
write access under your webapp's root.  In fact, many server admins 
dislike this, as they prefer a centralized log location for their 
systems.  But if you're the server admin, you're king ;)

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Adrian Beech [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 6:42 AM
To: 'Log4J Users List'
Subject: Creating log files relative to the web applications root 
directory?

G'day,

Is it possible to specify a log filename in the XML log4j properties
file
so
that it is relative to the web applications root directory?

I have the following in a log4j.xml file located in web-inf/classes
with
the
log4j jar in the web-inf/lib directory.  Logging seems to be fine
except
the
rascal.log file is being created in the Tomcat application directory 
under C:\Program Files\ and not in the C:\Tomcat 4.1\webapps\... 
Directory
tree.
I'd prefer to have the log files in something like 
../webapps/application/logs/logfilename.  Is this possible?

BTW, took a while to find the rascal.log file!!!

--[log4j.xml]-
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE log4j:configuration SYSTEM log4j.dtd

log4j:configuration

appender name=rf class=org.apache.log4j.RollingFileAppender
param name=file 

RE: Picking up wrong properties file in Weblogic

2003-08-04 Thread Ebersole, Steven
The problem is that it is using the java jvm class-loader [using
[EMAIL PROTECTED]

There is a class either in your system or server class-path attempting to
initialize log4j prior to your Struts stuff.  Once in a web-app or
enterprise-app, the class loader would be something named
WLContextClassLoader (I forgot the exact class name, but its a bea supplied
class).  Are you defining anything in the system or server class-path which
uses log4j (or even commons-logging)?  That would be a problem in weblogic.

Even to the point of security realms.  I had to end up removing all log4j
usage from our custom security realm beacause it got initialized before any
apps (and because weblogic loads all sec-realm classes on using the jvm
class-loader).

You pretty much have two options...
1) Seek out all libraries using either log4j/commons-logging and moving them
from the server class-path to the appropriate app-specific directory.
2) Place your log4j.properties file also in the system/server class-path.

Note that just about everthing from the jakarta uses either one of these two
logging libraries...



-Original Message-
From: Crumbo, Brian [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 7:39 AM
To: 'Log4J Users List'
Subject: RE: Picking up wrong properties file in Weblogic


Well, I seem to have really hit a brick wall on this one.  I turned
log4j.debug on and got:

log4j: Trying to find [log4j.properties] using
[EMAIL PROTECTED] class loader.
log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource: [log4j.properties].

I've verified that the properties file is in the war file's WEB-INF/classes
directory.  There are no log4j.properties files in the classpath anywhere.
I am using Weblogic 7.0.  I wonder if this might have something to do with
using a managed server.  Maybe I'll ask BEA.

-Original Message-
From: Steve Ebersole [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 5:52 PM
To: Log4J Users List
Subject: RE: Picking up wrong properties file in Weblogic


 Does this mean its not finding the properties file?
Yes

So the file is named log4j.properties or log4j.xml and is located in the
war's WEB-INF/classes directory?  That's strange, it should find it.

Have you tried with log4j.debug set to true?

You can try placing log4j.jar and the config file in the ear's root and
include manifest Class-Path entries in the manifest of the included wars and
ejb-jars.  Thats what I do, so I know that works.

Also, which version of weblogic.  I'm using 6.1sp4, and its worked fine for
me.  Wasn't their a version where weblogic was using log4j?  Maybe 7.x?



-Original Message-
From: Crumbo, Brian [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 1:33 PM
To: 'Log4J Users List'
Subject: RE: Picking up wrong properties file in Weblogic


The directory was in the system classpath.  I took it out, and now I get a
No appenders could be found for category (root). message.  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: Friday, August 01, 2003 2:23 PM
To: 'Log4J Users List'
Subject: RE: Picking up wrong properties file in Weblogic


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
reference log4j, it would not be able to see the stuff in the
WEB-INF/classes directory.

What else is inside the ear file?  Is everything in the ear supposed to
share that log4j config?



-Original Message-
From: Crumbo, Brian [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 12:48 PM
To: '[EMAIL PROTECTED]'
Subject: Picking up wrong properties file in Weblogic


I have deployed an application as an ear file to Weblogic.  The war file
within the ear file contains the log4j.properties file in the
WEB-INF/classes directory, and the log4j.jar in the WEB-INF/lib directory.
My understanding is that log4j should pick up the log4j.properties file from
the WEB-INF/classes directory by default. However, my application, for some
unknown reason, is picking up a log4j.properties file from elsewhere on my
machine...from a directory that contains a Java application that has not
been deployed.

Anybody know why log4j would be going outside the web app to pick up another
properties file?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED

RE: Picking up wrong properties file in Weblogic

2003-08-04 Thread Ebersole, Steven
You can take a look at the RespoistorySelector stuff that is part of log4j.
It is meant to address these kind of scenarios in server deployments.  A
thread or JNDI based implementation of a RepositorySelector may help you
solve this issue




-Original Message-
From: Crumbo, Brian [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 8:17 AM
To: 'Log4J Users List'
Subject: RE: Picking up wrong properties file in Weblogic


Bummer.  I think I'm in trouble, then.  The app is going to be running on a
common server with several other apps that use log4j.  In fact, our
company's 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 up wrong properties file in Weblogic


The problem is that it is using the java jvm class-loader [using
[EMAIL PROTECTED]

There is a class either in your system or server class-path attempting to
initialize log4j prior to your Struts stuff.  Once in a web-app or
enterprise-app, the class loader would be something named
WLContextClassLoader (I forgot the exact class name, but its a bea supplied
class).  Are you defining anything in the system or server class-path which
uses log4j (or even commons-logging)?  That would be a problem in weblogic.

Even to the point of security realms.  I had to end up removing all log4j
usage from our custom security realm beacause it got initialized before any
apps (and because weblogic loads all sec-realm classes on using the jvm
class-loader).

You pretty much have two options...
1) Seek out all libraries using either log4j/commons-logging and moving them
from the server class-path to the appropriate app-specific directory.
2) Place your log4j.properties file also in the system/server class-path.

Note that just about everthing from the jakarta uses either one of these two
logging libraries...



-Original Message-
From: Crumbo, Brian [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 7:39 AM
To: 'Log4J Users List'
Subject: RE: Picking up wrong properties file in Weblogic


Well, I seem to have really hit a brick wall on this one.  I turned
log4j.debug on and got:

log4j: Trying to find [log4j.properties] using
[EMAIL PROTECTED] class loader.
log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource: [log4j.properties].

I've verified that the properties file is in the war file's WEB-INF/classes
directory.  There are no log4j.properties files in the classpath anywhere.
I am using Weblogic 7.0.  I wonder if this might have something to do with
using a managed server.  Maybe I'll ask BEA.

-Original Message-
From: Steve Ebersole [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 5:52 PM
To: Log4J Users List
Subject: RE: Picking up wrong properties file in Weblogic


 Does this mean its not finding the properties file?
Yes

So the file is named log4j.properties or log4j.xml and is located in the
war's WEB-INF/classes directory?  That's strange, it should find it.

Have you tried with log4j.debug set to true?

You can try placing log4j.jar and the config file in the ear's root and
include manifest Class-Path entries in the manifest of the included wars and
ejb-jars.  Thats what I do, so I know that works.

Also, which version of weblogic.  I'm using 6.1sp4, and its worked fine for
me.  Wasn't their a version where weblogic was using log4j?  Maybe 7.x?



-Original Message-
From: Crumbo, Brian [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 1:33 PM
To: 'Log4J Users List'
Subject: RE: Picking up wrong properties file in Weblogic


The directory was in the system classpath.  I took it out, and now I get a
No appenders could be found for category (root). message.  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: Friday, August 01, 2003 2:23 PM
To: 'Log4J Users List'
Subject: RE: Picking up wrong properties file in Weblogic


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
reference log4j, it would not be able to see the stuff in the
WEB-INF/classes directory.

What else is inside the ear file?  Is everything in the ear supposed to
share that log4j config?



-Original Message-
From: Crumbo, Brian [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 12:48 PM
To: '[EMAIL PROTECTED]'
Subject: Picking up wrong

RE: Uncaught exception in PropertyConfigurator - log4j1.2.8 ?

2003-08-01 Thread Ebersole, Steven
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
{
PropertyConfigurator.configure( args[0] );
}
catch( Exception e )
{
BasicConfigurator.configure();
}

System.out.println(After catch block never reached!);
}


Log4j will then output all kinds of helpful information as it tries to
configure itself...

Also, what do you mean by crash?  If your getting an exception, how about
cutting and pasting the stack trace here so we can see whats happening.



-Original Message-
From: Desai, Chetan P [ITS] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 4:35 PM
To: [EMAIL PROTECTED]
Subject: Uncaught exception in PropertyConfigurator - log4j1.2.8 ?


I tried searching the mailing list but did not find a solution to the
following issue I face which causes my code to crash:
 a) If the filename specified in args[0] does not exist
 b) If there are syntax errors in the contents of the Configuration files
specified by args[0]

Any help/pointers will be appreciated.

==
 public static void main(String[] args) {
try {
PropertyConfigurator.configure(args[0]);
}catch(Exception e) {
BasicConfigurator.configure();
}

System.out.println(After catch block never reached!);
 }
==

-Chetan desai.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Picking up wrong properties file in Weblogic

2003-08-01 Thread Ebersole, Steven
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
reference log4j, it would not be able to see the stuff in the
WEB-INF/classes directory.

What else is inside the ear file?  Is everything in the ear supposed to
share that log4j config?



-Original Message-
From: Crumbo, Brian [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 12:48 PM
To: '[EMAIL PROTECTED]'
Subject: Picking up wrong properties file in Weblogic


I have deployed an application as an ear file to Weblogic.  The war file
within the ear file contains the log4j.properties file in the
WEB-INF/classes directory, and the log4j.jar in the WEB-INF/lib directory.
My understanding is that log4j should pick up the log4j.properties file from
the WEB-INF/classes directory by default. However, my application, for some
unknown reason, is picking up a log4j.properties file from elsewhere on my
machine...from a directory that contains a Java application that has not
been deployed.

Anybody know why log4j would be going outside the web app to pick up another
properties file?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: newbie: configuring log4j for EJB's inside weblogic

2003-07-31 Thread Ebersole, Steven
 share the servlet code?  What
does the environment entry refer to?

Regards,
Andreas

-Original 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 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 file with just a single servlet whose
sole
purpose is to configure log4j from an env-entry.


Option #1 is serviceable but not very flexible.  All classes running
within
that server must then use that configuration.  And further more, you
will
not be able to hot-deploy components.



Why write a startup class (i.e., weblogic startup class as opposed to
starup
servlet) to acheive this?  #1 does the same thing...






-Original Message-
From: Andreas Bothner [ MTN - Innovation Centre ]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 12:05 PM
To: [EMAIL PROTECTED]
Subject: newbie: configuring log4j for EJB's inside weblogic


Hi,



I would prefer not to put the log4j jar file into each EJB application
jar file, so I have tried to put the log4j jar into the classpath and
then simply start the app server.  I expected my EJB's to find the
Logger class, but was disappointed to get a ClassNotFound Exception.  Is
it possible to use log4j without deploying the jar with each application
jar?



The other question I have is when to configure log4j.  I think it would
be overkill to put this code into each EJB implementation.  Would I be
right in thinking that I should create a startup class that the
application server runs when booting and that this class must call the
configureAndWatch() method???



Regards,

Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: newbie: configuring log4j for EJB's inside weblogic

2003-07-30 Thread Ebersole, Steven
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 file with just a single servlet whose sole
purpose is to configure log4j from an env-entry.


Option #1 is serviceable but not very flexible.  All classes running within
that server must then use that configuration.  And further more, you will
not be able to hot-deploy components.



Why write a startup class (i.e., weblogic startup class as opposed to starup
servlet) to acheive this?  #1 does the same thing...






-Original Message-
From: Andreas Bothner [ MTN - Innovation Centre ]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 12:05 PM
To: [EMAIL PROTECTED]
Subject: newbie: configuring log4j for EJB's inside weblogic


Hi,

 

I would prefer not to put the log4j jar file into each EJB application
jar file, so I have tried to put the log4j jar into the classpath and
then simply start the app server.  I expected my EJB's to find the
Logger class, but was disappointed to get a ClassNotFound Exception.  Is
it possible to use log4j without deploying the jar with each application
jar?

 

The other question I have is when to configure log4j.  I think it would
be overkill to put this code into each EJB implementation.  Would I be
right in thinking that I should create a startup class that the
application server runs when booting and that this class must call the
configureAndWatch() method???

 

Regards,

Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Serialization of LoggingEvent message field

2003-07-24 Thread Ebersole, Steven
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 field


My opologies, I meant LocationInfo.

-Sanjay

-Original Message-
From: Steve Ebersole [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 6:02 PM
To: Log4J Users List; [EMAIL PROTECTED]
Subject: RE: Serialization of LoggingEvent message field


What do you mean by Localization Info?  Are you talking about the
LocationInfo object?  Or some kind of custom i18n/localized data?



-Original Message-
From: Sanjay Gupta (sanjaygu) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 8:04 PM
To: [EMAIL PROTECTED]
Subject: Serialization of LoggingEvent message field


Hi,

I am sending the LoggingEvent over wire (SocketAppender). The message
object in my case is a custom object I created called a LoggerMessage.
This is a simple container class which holds multiple fields (all
serializable) that we need to transfer over the wire.  Now obviously we
are unable to transfer this due to the the fact that message object in a
LoggingEvent is not serialized. So, how do I send the LoggingEvent with
my Custom Message Object. Here is what I tried - 1. One solution I  came
up with was to wrap the LoggingEvent object and our LoggerMessage object
in a serializable wrapper class that we created, and transfer that over
the wire.  Then on the other end, we deserialize the wrapper from the
stream, pull out the LoggerMessage and the LoggerEvent out, and assign
the LoggerMessage to the LoggingEvent as its message field (overwriting
the String value that it would have after the serialization process).
However, this is where we ran into our problem. There is no setter
method to set the message object in a LoggingEvent. 2. Another solution
I came up with was to xml-ize the LoggingEvent Object info and then
create a LoggingEvent object on the other end. But then how do I set
Localization Info?

Anone has any thoughts how to achieve this?

Regards,
-SAnjay



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4J and EJBs

2003-07-15 Thread Ebersole, Steven
 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 the heading of business data; typically I want log messages to be
written iregardless of whether a transaction commits or rollbacks.




-Original Message-
From: Jonathan Whitall [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 9:05 AM
To: [EMAIL PROTECTED]
Subject: Log4J and EJBs


Hello,

This is more of a generic third-party logging question
as opposed to a Log4J question, but I thought some of
you might know the answer.

The EJB specification says that an EJB should not
perform file I/O.  I was wondering why this is the
case, and if using a third-party logging package (such
as Log4J) constitutes a violation of this nature if it
is set up to use a FileAppender.

Thanks for your input,

Jonathan

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Newbie Question

2003-07-11 Thread Ebersole, Steven
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
directory from where the java process was started).



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:02 AM
To: [EMAIL PROTECTED]
Subject: Newbie Question



I am using Log4j for the first time.  How do I set up a property file
(correctly) so I only log to a file and not to the console?  I only want
messages at level INFO or higher in my log file.  This is what I tried.  It
didn't work:


log4j.rootLogger = INFO

log4j.DamlBuilder=INFO, FILE

#log4j.appender.CONSOLE=org.appache.log4j.ConsoleAppender

#set the appender FILE
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=.\log.txt

#set the layout for the appenders
#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
#log4j.appender.CONSOLE.layout.conversionPattern=%p -%m%n

#set the layout for the appenders
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%p -%m%n

Thanks,

Neil

Neil Hainer
Booz Allen  Hamilton
JIVA System Integration Project
703-289-3881


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Newbie Question

2003-07-11 Thread Ebersole, Steven
You should not be.  In what type of environment is this running?  In Tomcat?
In an app-server?



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:11 AM
To: Log4J Users List
Subject: RE: Newbie Question


Steven,

Thanks.  This works, but I 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
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
directory from where the java process was started).



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:02 AM
To: [EMAIL PROTECTED]
Subject: Newbie Question



I am using Log4j for the first time.  How do I set up a property file
(correctly) so I only log to a file and not to the console?  I only want
messages at level INFO or higher in my log file.  This is what I tried.  It
didn't work:


log4j.rootLogger = INFO

log4j.DamlBuilder=INFO, FILE

#log4j.appender.CONSOLE=org.appache.log4j.ConsoleAppender

#set the appender FILE
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=.\log.txt

#set the layout for the appenders
#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
#log4j.appender.CONSOLE.layout.conversionPattern=%p -%m%n

#set the layout for the appenders
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%p -%m%n

Thanks,

Neil

Neil Hainer
Booz Allen  Hamilton
JIVA System Integration Project
703-289-3881


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Newbie Question

2003-07-11 Thread Ebersole, Steven
How are you doing the initialization of log4j?

Are you possibly using jakarta-commons-logging or using something that uses
it?



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:21 AM
To: Log4J Users List
Subject: RE: Newbie Question


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?



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:11 AM
To: Log4J Users List
Subject: RE: Newbie Question


Steven,

Thanks.  This works, but I 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
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
directory from where the java process was started).



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:02 AM
To: [EMAIL PROTECTED]
Subject: Newbie Question



I am using Log4j for the first time.  How do I set up a property file
(correctly) so I only log to a file and not to the console?  I only want
messages at level INFO or higher in my log file.  This is what I tried.  It
didn't work:


log4j.rootLogger = INFO

log4j.DamlBuilder=INFO, FILE

#log4j.appender.CONSOLE=org.appache.log4j.ConsoleAppender

#set the appender FILE
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=.\log.txt

#set the layout for the appenders
#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
#log4j.appender.CONSOLE.layout.conversionPattern=%p -%m%n

#set the layout for the appenders
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%p -%m%n

Thanks,

Neil

Neil Hainer
Booz Allen  Hamilton
JIVA System Integration Project
703-289-3881


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Newbie Question

2003-07-11 Thread Ebersole, Steven
You say just part of a java app...  Some other part of that app must be
doing something with log4j.  Try the code in your last message in a simple
main method using the property file; something like:


public class Tester
{
private static Logger logger = Logger.getLogger( Tester.class );

public static void main( String[] args )
{
logger.info( Testing );
}
}

This will put a single log message into your log.txt file without it showing
up on stdout.



You can also slightly modify the properties file to subvert whatever else is
playing with log4j...

log4j.rootLogger=INFO
log4j.DamlBuilder=INFO,FILE
log4j.additivity.DamlBuilder=false
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

which basically tells lo4j to log messages sent to the logger named
DamlBuilder _only_ to appenders explicitly attached to it, and not the
appenders of loggers higher in its hierarchy.  This is assuming that the
DamlBuilder class is not in a package; if it is, then make the changes in
the above two lines to include its package name...



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:30 AM
To: Log4J Users List
Subject: RE: Newbie Question


I initialize it with the following line of code:

private static Logger logger = Logger.getLogger( DamlBuilder.class );

The only other line is:

logger.info( Input file:   + getInputFileName() + two_spaces +

   Output file:   + getOutputFileName() + two_spaces +
instances +  Object Instances Created + 
   two_spaces + QuickTimeFormat.msToSecs( pTime ) + 
seconds. ); 

-Original Message-
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-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:21 AM
To: Log4J Users List
Subject: RE: Newbie Question


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?



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:11 AM
To: Log4J Users List
Subject: RE: Newbie Question


Steven,

Thanks.  This works, but I 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
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
directory from where the java process was started).



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:02 AM
To: [EMAIL PROTECTED]
Subject: Newbie Question



I am using Log4j for the first time.  How do I set up a property file
(correctly) so I only log to a file and not to the console?  I only want
messages at level INFO or higher in my log file.  This is what I tried.  It
didn't work:


log4j.rootLogger = INFO

log4j.DamlBuilder=INFO, FILE

#log4j.appender.CONSOLE=org.appache.log4j.ConsoleAppender

#set the appender FILE
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=.\log.txt

#set the layout for the appenders
#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
#log4j.appender.CONSOLE.layout.conversionPattern=%p -%m%n

#set the layout for the appenders
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%p -%m%n

Thanks,

Neil

Neil Hainer
Booz Allen  Hamilton
JIVA System Integration Project
703-289-3881


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e

RE: Newbie Question

2003-07-11 Thread Ebersole, Steven
Sorry, bad copy and paste job.  The property file should actually look like:

log4j.rootLogger=INFO
log4j.logger.DamlBuilder=INFO,FILE
log4j.additivity.DamlBuilder=false
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




-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 something with log4j.  Try the code in your last message in a simple
main method using the property file; something like:


public class Tester
{
private static Logger logger = Logger.getLogger( Tester.class );

public static void main( String[] args )
{
logger.info( Testing );
}
}

This will put a single log message into your log.txt file without it showing
up on stdout.



You can also slightly modify the properties file to subvert whatever else is
playing with log4j...

log4j.rootLogger=INFO
log4j.DamlBuilder=INFO,FILE
log4j.additivity.DamlBuilder=false
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

which basically tells lo4j to log messages sent to the logger named
DamlBuilder _only_ to appenders explicitly attached to it, and not the
appenders of loggers higher in its hierarchy.  This is assuming that the
DamlBuilder class is not in a package; if it is, then make the changes in
the above two lines to include its package name...



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:30 AM
To: Log4J Users List
Subject: RE: Newbie Question


I initialize it with the following line of code:

private static Logger logger = Logger.getLogger( DamlBuilder.class );

The only other line is:

logger.info( Input file:   + getInputFileName() + two_spaces +

   Output file:   + getOutputFileName() + two_spaces +
instances +  Object Instances Created + 
   two_spaces + QuickTimeFormat.msToSecs( pTime ) + 
seconds. ); 

-Original Message-
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-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:21 AM
To: Log4J Users List
Subject: RE: Newbie Question


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?



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:11 AM
To: Log4J Users List
Subject: RE: Newbie Question


Steven,

Thanks.  This works, but I 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
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
directory from where the java process was started).



-Original Message-
From: Hainer, Neil [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 11:02 AM
To: [EMAIL PROTECTED]
Subject: Newbie Question



I am using Log4j for the first time.  How do I set up a property file
(correctly) so I only log to a file and not to the console?  I only want
messages at level INFO or higher in my log file.  This is what I tried.  It
didn't work:


log4j.rootLogger = INFO

log4j.DamlBuilder=INFO, FILE

#log4j.appender.CONSOLE=org.appache.log4j.ConsoleAppender

#set the appender FILE
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=.\log.txt

#set the layout for the appenders
#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
#log4j.appender.CONSOLE.layout.conversionPattern=%p -%m%n

#set the layout for the appenders
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%p -%m%n

Thanks,

Neil

Neil Hainer
Booz Allen  Hamilton
JIVA System Integration Project
703-289-3881


-
To unsubscribe, e-mail: [EMAIL PROTECTED

RE: Logging appears in catalina out

2003-07-01 Thread Ebersole, Steven
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 hierarchy:

log4j.additivity.blccpl.common.hook.ichook=false




-Original Message-
From: Scott Burns [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 01, 2003 5:43 AM
To: Log4J Users List
Subject: Logging appears in catalina out


We have written a wrapper around log4j.  Each web application logs to a
file specified in its property file.  The problem is that I am seeing
logging messages also appearing in catalina out(Tomcat/4.1.18).  This
does not occur on systems using tomcat 4.0.6.  Below is a sample of one
of the web applications configuration property files.  Any suggestions
or thoughts on why this is getting sent to catalina out would be
appreciated.  Is our setup incorrect? Also I can't changes versions app
servers so this is not an option.  Thanks in advance.

Scott


Web App
log4j.debug=true
log4j.logger.blccpl.common.hook.ichook=DEBUG, IC1
log4j.appender.IC1=org.apache.log4j.RollingFileAppender
log4j.appender.IC1.File=/apps/tomcat/share/logs/ICHook.log
log4j.appender.IC1.layout=org.apache.log4j.PatternLayout
log4j.appender.IC1.layout.ConversionPattern=%d{DATE} [%p] %c{1}.%M -
%m%n
log4j.appender.IC1.MaxFileSize=5000KB
log4j.appender.IC1.MaxBackupIndex=30

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: org.apache.log4j.spi.LoggingEvent

2003-06-24 Thread Ebersole, Steven
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
ByteArrayOutputStream serBaOut = new ByteArrayOutputStream();
ObjectOutputStream serOut = new ObjectOutputStream( serBaOut );

log.debug( Starting serialization out... );
serOut.writeObject( incoming );
log.debug( Serialization out complete );

// Now, re-constitue the model from memory
ByteArrayInputStream serBaIn = 
new ByteArrayInputStream( serBaOut.toByteArray() );
ObjectInputStream serIn = new ObjectInputStream( serBaIn );

log.debug( Starting serialization in... );
Object outgoing = serIn.readObject();
log.debug( Serialization in complete );

return outgoing;
}
catch( ClassNotFoundException cnfe )
{
throw new java.io.IOException( Unable to locate class on
reconstitution );
}
}


-Original Message-
From: Damian ONeill [AePONA] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 3:19 AM
To: Log4J Users List
Subject: Re: org.apache.log4j.spi.LoggingEvent


We are using log4j for logging events to an event manager via the socket 
appender.  The event manager is running in a separate process and uses a 
object input stream to build the received LoggingEvent.  The Event 
Manager has a internal event chain that event sinks can register with to 
receive the logging event.  The event sinks extend an adapter class that 
provides support for handling the event.  The adapter implements 
runnable and has a wait queue.  Each adapter is kicked off as a separate 
thread where the run method dequeues the event and passes it to an 
abstract method that the base class must implement.

I wish to clone the LoggingEvent so that each adapter sub class 
(separate thread) has its own copy of the event to do with as it wishes. 
 We invoke the Event Sinks dynamically so that the framework can be 
extended by third parties, therefore I cannot guarantee or impose 
restrictions on what the adapter class may do with the event.

Since the javadoc does not say whether the LoggingEvent is thread safe, 
the simplest way for me to guarantee no issues is to clone the event 
before I pass it to the adapter sub class.


Hope this helps,
Damian.




Ceki Gülcü wrote:


 Damian,

 LoggingEvent is not clonable and this has not been a problem this far.
 Can you please explain what you are trying to accomplish by cloning 
 LoggingEvent objects?

 At 04:38 PM 6/23/2003 +, you wrote:

 Is there anyone on this list that can answer this question? or is the 
 the developers list more suitable?

 Thanks.

 Damian ONeill [AePONA] wrote:

 Can you please suggest the best way to clone a LoggingEvent?

 Thanks in advance,
 Damian ONeill.


 -- 
 [EMAIL PROTECTED]

 Damian O'Neill
 Software Engineer
 AePONA Ltd,
 Interpoint Building,
 20-24 York Street,
 Belfast,
 BT15 1AQ

 +44 (0) 2890 275246

 http://www.aepona.com




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -- 
 Ceki  For log4j documentation consider The complete log4j manual
   ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-- 
[EMAIL PROTECTED]

Damian O'Neill
Software Engineer
AePONA Ltd,
Interpoint Building,
20-24 York Street,
Belfast,
BT15 1AQ

+44 (0) 2890 275246

http://www.aepona.com




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: org.apache.log4j.spi.LoggingEvent

2003-06-24 Thread Ebersole, Steven
Performance is directly related to the size/depth of the object being
serialized.  A LoggingEvent isn't very large (minus extensive MDC usage), so
the impact should be minimal...


-Original Message-
From: Damian ONeill [AePONA] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 8:36 AM
To: Log4J Users List
Subject: Re: org.apache.log4j.spi.LoggingEvent


Thanks Steven, this will certainly solve my issue.  Do you have any idea 
of how performant this method is?

I am surprised that nobody else has asked for this type of functionality 
before in LoggingEvent.  Is there a chance 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
{
try
{
// Serialize the incoming out to memory
ByteArrayOutputStream serBaOut = new ByteArrayOutputStream();
ObjectOutputStream serOut = new ObjectOutputStream( serBaOut );

log.debug( Starting serialization out... );
serOut.writeObject( incoming );
log.debug( Serialization out complete );

// Now, re-constitue the model from memory
ByteArrayInputStream serBaIn = 
new ByteArrayInputStream( serBaOut.toByteArray() );
ObjectInputStream serIn = new ObjectInputStream( serBaIn );

log.debug( Starting serialization in... );
Object outgoing = serIn.readObject();
log.debug( Serialization in complete );

return outgoing;
}
catch( ClassNotFoundException cnfe )
{
throw new java.io.IOException( Unable to locate class on
reconstitution );
}
}


-Original Message-
From: Damian ONeill [AePONA] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 3:19 AM
To: Log4J Users List
Subject: Re: org.apache.log4j.spi.LoggingEvent


We are using log4j for logging events to an event manager via the socket 
appender.  The event manager is running in a separate process and uses a 
object input stream to build the received LoggingEvent.  The Event 
Manager has a internal event chain that event sinks can register with to 
receive the logging event.  The event sinks extend an adapter class that 
provides support for handling the event.  The adapter implements 
runnable and has a wait queue.  Each adapter is kicked off as a separate 
thread where the run method dequeues the event and passes it to an 
abstract method that the base class must implement.

I wish to clone the LoggingEvent so that each adapter sub class 
(separate thread) has its own copy of the event to do with as it wishes. 
 We invoke the Event Sinks dynamically so that the framework can be 
extended by third parties, therefore I cannot guarantee or impose 
restrictions on what the adapter class may do with the event.

Since the javadoc does not say whether the LoggingEvent is thread safe, 
the simplest way for me to guarantee no issues is to clone the event 
before I pass it to the adapter sub class.


Hope this helps,
Damian.




Ceki Gülcü wrote:

  

Damian,

LoggingEvent is not clonable and this has not been a problem this far.
Can you please explain what you are trying to accomplish by cloning 
LoggingEvent objects?

At 04:38 PM 6/23/2003 +, you wrote:



Is there anyone on this list that can answer this question? or is the 
the developers list more suitable?

Thanks.

Damian ONeill [AePONA] wrote:

  

Can you please suggest the best way to clone a LoggingEvent?

Thanks in advance,
Damian ONeill.



-- 
[EMAIL PROTECTED]

Damian O'Neill
Software Engineer
AePONA Ltd,
Interpoint Building,
20-24 York Street,
Belfast,
BT15 1AQ

+44 (0) 2890 275246

http://www.aepona.com




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  

-- 
Ceki  For log4j documentation consider The complete log4j manual
  ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




  


-- 
[EMAIL PROTECTED]

Damian O'Neill
Software Engineer
AePONA Ltd,
Interpoint Building,
20-24 York Street,
Belfast,
BT15 1AQ

+44 (0) 2890 275246

http://www.aepona.com



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem with RollingFileAppender

2003-06-13 Thread Ebersole, Steven
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


-Original Message-
From: Raj Nella [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2003 10:49 AM
To: Log4J Users List
Subject: Re: problem with RollingFileAppender


the directory exists. when i added log4j.debug=true
the following messages appeared:
[6/13/03 10:44:37:140 PDT] 6623ee73 SystemOut O
log4j: Parsing for [root] with value=[debug, stdout,
R, A1].
[6/13/03 10:44:37:140 PDT] 6623ee73 SystemOut O
log4j: Level token is [debug].
[6/13/03 10:44:37:150 PDT] 6623ee73 SystemOut O
log4j: Category root set to DEBUG
[6/13/03 10:44:37:150 PDT] 6623ee73 SystemOut O
log4j: Parsing appender named stdout.
[6/13/03 10:44:37:331 PDT] 6623ee73 SystemOut O
log4j: Parsing layout options for stdout.
[6/13/03 10:44:37:421 PDT] 6623ee73 SystemOut O
log4j: Setting property [conversionPattern] to [%5p
[%t] (%F:%L) - %m%n].
[6/13/03 10:44:37:421 PDT] 6623ee73 SystemOut O
log4j: End of parsing for stdout.
[6/13/03 10:44:37:631 PDT] 6623ee73 SystemOut O
log4j: Parsed stdout options.
[6/13/03 10:44:37:641 PDT] 6623ee73 SystemOut O
log4j: Parsing appender named R.
[6/13/03 10:44:37:671 PDT] 6623ee73 SystemOut O
log4j: Parsing layout options for R.
[6/13/03 10:44:37:671 PDT] 6623ee73 SystemOut O
log4j: Setting property [conversionPattern] to [%p %t
%c %x - %m%n].
[6/13/03 10:44:37:681 PDT] 6623ee73 SystemOut O
log4j: End of parsing for R.
[6/13/03 10:44:37:751 PDT] 6623ee73 SystemOut O
log4j: Setting property [file] to
[C:Log4jTestLog4jTesterWeb Contentexample.log].
[6/13/03 10:44:37:751 PDT] 6623ee73 SystemOut O
log4j: Setting property [maxFileSize] to [100KB].
[6/13/03 10:44:37:751 PDT] 6623ee73 SystemOut O
log4j: Setting property [maxBackupIndex] to [1].
[6/13/03 10:44:37:761 PDT] 6623ee73 SystemOut O
log4j: setFile called: C:Log4jTestLog4jTesterWeb
Contentexample.log, true
[6/13/03 10:44:37:781 PDT] 6623ee73 SystemOut O
log4j: setFile ended
[6/13/03 10:44:37:781 PDT] 6623ee73 SystemOut O
log4j: Parsed R options.
[6/13/03 10:44:37:781 PDT] 6623ee73 SystemOut O
log4j: Parsing appender named A1.
[6/13/03 10:44:40:385 PDT] 6623ee73 SystemOut O
log4j: Parsed A1 options.
[6/13/03 10:44:40:395 PDT] 6623ee73 SystemOut O
log4j: Finished configuring.


--- Alison Ortega [EMAIL PROTECTED] wrote:
 You could turn on debugging:
 -log4j.debug=true
 
 Also, the directory for the log file must exist.  It
 will create the
 file, but the dir must be there.
 
 Alison Ortega
 North Carolina State University
 ACS 
 Systems Programmer II
 919-513-1417
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Strange behaviour with log4j and weblogic

2003-06-12 Thread Ebersole, Steven
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
the changes to be recognized.

These classes have statically defined logger instances.

Log4j is deployed into the web-app's WEB-INF/lib directory.  I initialize
log4j through a startup servlet defined for the web-app doing a
confugureAndWatch().  The config file is set to append all messages to a
file.

On first startup, this works.  All of my log messages go to the defined log.

However, upon first dynamic class file replacement starnge things begin to
happen.  Some of these messages are still sent to the file (from roughly 3
classes).  Some are now redirected to the console somehow (from a particular
package) and the rest are just lost (or at least dont show up in the file or
console).

Anyone encountered something similiar?  It is so bizarre that I am at a loss
as to where to even start looking.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Strange behaviour with log4j and weblogic

2003-06-12 Thread Ebersole, Steven
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:  Strange behaviour with log4j and weblogic
 
 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 the changes to be recognized.
 
 These classes have statically defined logger instances.
 
 Log4j is deployed into the web-app's WEB-INF/lib directory.  I initialize
 log4j through a startup servlet defined for the web-app doing a
 confugureAndWatch().  The config file is set to append all messages to a
 file.
 
 On first startup, this works.  All of my log messages go to the defined
 log.
 
 However, upon first dynamic class file replacement starnge things begin to
 happen.  Some of these messages are still sent to the file (from roughly 3
 classes).  Some are now redirected to the console somehow (from a
 particular package) and the rest are just lost (or at least dont show up
 in the file or console).
 
 Anyone encountered something similiar?  It is so bizarre that I am at a
 loss as to where to even start looking.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Strange behaviour with log4j and weblogic

2003-06-12 Thread Ebersole, Steven
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ü [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 10:07 AM
To: Log4J Users List
Subject: Re: Strange behaviour with log4j and weblogic



I've used Weblogic 6.1 sp2 in dev mode but always without configureAndWatch.

Which package is redirected to the console?


At 09:52 AM 6/12/2003 -0500, you wrote:
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
the changes to be recognized.

These classes have statically defined logger instances.

Log4j is deployed into the web-app's WEB-INF/lib directory.  I initialize
log4j through a startup servlet defined for the web-app doing a
confugureAndWatch().  The config file is set to append all messages to a
file.

On first startup, this works.  All of my log messages go to the defined
log.

However, upon first dynamic class file replacement starnge things begin to
happen.  Some of these messages are still sent to the file (from roughly 3
classes).  Some are now redirected to the console somehow (from a
particular
package) and the rest are just lost (or at least dont show up in the file
or
console).

Anyone encountered something similiar?  It is so bizarre that I am at a
loss
as to where to even start looking.

--
Ceki  For log4j documentation consider The complete log4j manual
   ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Appender per Logger

2003-06-11 Thread Ebersole, Steven

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:
!--###--
appender name=appender1 class=...
...
/appender

appender name=appender2 class=...
...
/appender

appender name=appender3 class=...
...
/appender

logger name=specificLogger1
level value=debug/
appender-ref ref=appender2 /
/logger

logger name=specificLogger2
level value=debug/
appender-ref ref=appender3 /
/logger

root
level value =debug /
appender-ref ref=appender1 /
/root




-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 6:28 PM
To: Log4J Users List
Subject: Appender per Logger


hi
This might be a basic question. How do I specify a different appender
per logger, the way we specify log levels for individual loggers?

Thanks
--Viv



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Duplicate Triggering of custom appender.

2003-06-11 Thread Ebersole, Steven
To which loggers?

-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 6:39 PM
To: Log4J Users List
Subject: RE: Duplicate Triggering of custom appender.


Hi
The name of the appender I want to use is SOAPAppender and I add it
programmatically to the logger instances.


log4j.rootLogger=debug
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.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=deliveryModule.log

log4j.appender.JMS1=org.apache.log4j.net.JMSAppender
log4j.appender.JMS1.ProviderURL=ormi://localhost:6001
log4j.appender.JMS1.SecurityPrincipalName=admin
log4j.appender.JMS1.SecurityCredentials=bitfone
log4j.appender.JMS1.InitialContextFactoryName=com.evermind.server.Applicatio
nClientInitialContextFactory
log4j.appender.JMS1.TopicBindingName=jms/theTopic
log4j.appender.JMS1.TopicConnectionFactoryBindingName=jms/theTopicConnection
Factory

# Print only messages of level WARN or above in the package 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, June 11, 2003 5:30 PM
To: Log4J Users List
Subject: RE: Duplicate Triggering of custom appender.


i have set it to false for that particular Logger instance. 

On Wed, 2003-06-11 at 15:22, Ebersole, Steven wrote:

Make sure you dont have an additivity issue.  



-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 5:21 PM
To: [EMAIL PROTECTED]
Cc: Log4J Users List
Subject: Re: Duplicate Triggering of custom appender.


Hi
Below is the appender code. As you see there is not a lot of
implementation details in the appender. The append() method gets
triggered twice the number of times I log messages... 

public class SOAPAppender extends AppenderSkeleton implements
org.apache.log4j.Appender {
  /**
* A static Object that maintains message batch
*/
   private static ArrayList messages = new ArrayList();

  public static int hits = 0;

  public SOAPAppender() {
super();
  }

  public void append(LoggingEvent parm1) {
Object obj = parm1.getMessage();
LogMessageBase logObj = null;
System.out.println( Appender Triggered );
 hits++;
synchronized ( messages ) {
if ( messages.size() == 20 ) {
  messages.add(obj);
  System.out.println(Now make a soap call: with message
list
size :   + messages.size()
+  and clear the List of messages);
  messages.clear();
}
else {
  messages.add(obj);
}
  }
   System.out.println( This was the  + hits +  hit. );
/[EMAIL PROTECTED] Implement this org.apache.log4j.AppenderSkeleton
abstract
method*/
  }
  public boolean requiresLayout() {
  return true;
  }
  public void close() {
/[EMAIL PROTECTED] Implement this org.apache.log4j.Appender abstract
method*/
  }

}



On Wed, 2003-06-11 at 15:05, Yoav Shapira wrote:

Howdy,
It would be easier (for me at least ;)) to diagnose your problem
if
you
post
the source code to your appender...

Yoav Shapira

--- Vivek Kapadekar [EMAIL PROTECTED] wrote:
 Hi 
 I have written my own simple appender ( this is the first time
I
am
 writing an appender). I attach the appender to the Logger
using
 addAppender(). In my client class I log six messages, but what
the
 appenders append() method gets triggered 12 times.  I thought
it
might
 be due to the hierarchy , and the duplicate perhaps was made
by
the
 rootLogger, but i have set the additivity flag to false, still
I
get
 duplicate hits to my appender.
 Can anybody shed light on this?
 
 Thanks
 
 --Vivek
 
 


=
Yoav Shapira
[EMAIL PROTECTED

RE: Duplicate Triggering of custom appender.

2003-06-11 Thread Ebersole, Steven
Try the following just to see if you still get the same issue (and do _not_
programatically add the appender):


##
#  Define loggers
##
log4j.rootLogger=debug, stdout
log4j.additivity.rootLogger=false

log4j.logger.SYSTEM=DEBUG, soap
log4j.logger.AUDIT=DEBUG, soap
log4j.logger.TRANSACTION=DEBUG, soap

##
#  Define appenders
##
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.soap=your.soap.appender.class.name
#... your appender's config parameters



-Original 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?

-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 6:39 PM
To: Log4J Users List
Subject: RE: Duplicate Triggering of custom appender.


Hi
The name of the appender I want to use is SOAPAppender and I add it
programmatically to the logger instances.


log4j.rootLogger=debug
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.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=deliveryModule.log

log4j.appender.JMS1=org.apache.log4j.net.JMSAppender
log4j.appender.JMS1.ProviderURL=ormi://localhost:6001
log4j.appender.JMS1.SecurityPrincipalName=admin
log4j.appender.JMS1.SecurityCredentials=bitfone
 
log4j.appender.JMS1.InitialContextFactoryName=com.evermind.server.Applicatio
nClientInitialContextFactory
log4j.appender.JMS1.TopicBindingName=jms/theTopic
 
log4j.appender.JMS1.TopicConnectionFactoryBindingName=jms/theTopicConnection
Factory

# Print only messages of level WARN or above in the package 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, June 11, 2003 5:30 PM
To: Log4J Users List
Subject: RE: Duplicate Triggering of custom appender.


i have set it to false for that particular Logger instance. 

On Wed, 2003-06-11 at 15:22, Ebersole, Steven wrote:

Make sure you dont have an additivity issue.  



-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 5:21 PM
To: [EMAIL PROTECTED]
Cc: Log4J Users List
Subject: Re: Duplicate Triggering of custom appender.


Hi
Below is the appender code. As you see there is not a lot of
implementation details in the appender. The append() method gets
triggered twice the number of times I log messages... 

public class SOAPAppender extends AppenderSkeleton implements
org.apache.log4j.Appender {
  /**
* A static Object that maintains message batch
*/
   private static ArrayList messages = new ArrayList();

  public static int hits = 0;

  public SOAPAppender() {
super();
  }

  public void append(LoggingEvent parm1) {
Object obj = parm1.getMessage();
LogMessageBase logObj = null;
System.out.println( Appender Triggered );
 hits++;
synchronized ( messages ) {
if ( messages.size() == 20 ) {
  messages.add(obj);
  System.out.println(Now make a soap call: with message
list
size :   + messages.size()
+  and clear the List of
messages);
  messages.clear();
}
else {
  messages.add(obj

RE: Duplicate Triggering of custom appender.

2003-06-11 Thread Ebersole, Steven
No problem

-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 7:17 PM
To: Log4J Users List
Subject: RE: Duplicate Triggering of custom appender.


Yup that worked,  I think i had not set the additivity flag right..
Thanks for your help

--Viv

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
##
log4j.rootLogger=debug, stdout
log4j.additivity.rootLogger=false

log4j.logger.SYSTEM=DEBUG, soap
log4j.logger.AUDIT=DEBUG, soap
log4j.logger.TRANSACTION=DEBUG, soap

##
#  Define appenders
##
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.soap=your.soap.appender.class.name
#... your appender's config parameters



-Original 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?

-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 6:39 PM
To: Log4J Users List
Subject: RE: Duplicate Triggering of custom appender.


Hi
The name of the appender I want to use is SOAPAppender and I add it
programmatically to the logger instances.


log4j.rootLogger=debug
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.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=deliveryModule.log

log4j.appender.JMS1=org.apache.log4j.net.JMSAppender
log4j.appender.JMS1.ProviderURL=ormi://localhost:6001
log4j.appender.JMS1.SecurityPrincipalName=admin
log4j.appender.JMS1.SecurityCredentials=bitfone
 
 
log4j.appender.JMS1.InitialContextFactoryName=com.evermind.server.Applicatio
nClientInitialContextFactory
log4j.appender.JMS1.TopicBindingName=jms/theTopic
 
 
log4j.appender.JMS1.TopicConnectionFactoryBindingName=jms/theTopicConnection
Factory

# Print only messages of level WARN or above in the package 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, June 11, 2003 5:30 PM
To: Log4J Users List
Subject: RE: Duplicate Triggering of custom appender.


i have set it to false for that particular Logger instance. 

On Wed, 2003-06-11 at 15:22, Ebersole, Steven wrote:

Make sure you dont have an additivity issue.  



-Original Message-
From: Vivek Kapadekar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 5:21 PM
To: [EMAIL PROTECTED]
Cc: Log4J Users List
Subject: Re: Duplicate Triggering of custom appender.


Hi
Below is the appender code. As you see there is not a lot of
implementation details in the appender. The append() method
gets
triggered twice the number of times I log messages... 

public class SOAPAppender extends AppenderSkeleton
implements
org.apache.log4j.Appender {
  /**
* A static Object that maintains message batch
*/
   private static ArrayList messages = new ArrayList();

  public static int hits = 0

RE: log4j in clustered j2ee environment.

2003-04-04 Thread Ebersole, Steven
Another note, the JMS appender can be problematic if the JMS destination
goes down after the appender has been initialized.  The only way I was able
to get the JMS appenders to work again was to bring down the app server from
which logging was originating.  Ouch ;o)

But you could look at doing 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 j2ee environment.
|
|
|The two best options for centralized logging from within a 
|J2EE app will be
|either the socket-based appenders or the JMS-based 
|appenders.  Both will let
|you send the logs to a centralized location and deal with 
|them there.
|
|The JMS approach is reliable because it is using the JMS 
|protocol, however
|this reliability comes with a price in terms of the JMS 
|overhead.  But it is
|ideal if you need logging to be either transactional or 
|never-ever lost.
|
|The socket approach is faster, bu the best of the socket 
|approaches (from a
|j2ee perspective) would be the SocketHub approach which 
|can drop messages
|under certain circumstances.
|
|It all depends which ones strenghts are the most important 
|to you
|
|
||-Original Message-
||From: [EMAIL PROTECTED] 
||[mailto:[EMAIL PROTECTED]
||Sent: Friday, April 04, 2003 12:17 AM
||To: [EMAIL PROTECTED]
||Subject: log4j in clustered j2ee environment.
||
||
||
||Hi,
||
||I want to have centralized logging in J2EE clustered 
|environment.
||
||Anybody have done this before ?
||
||I am trying to understand how it can be done and issues 
||related to it, before i 
||start.
||
||what is the impact on performance ?
||
||TIA
||Shahaji
||
||
||---
||--
||To unsubscribe, e-mail: 
|[EMAIL PROTECTED]
||For additional commands, e-mail: 
|[EMAIL PROTECTED]
||
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logging from same class to 2 different log files and each configu red with its own level

2003-04-03 Thread Ebersole, Steven
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 to set this up depend on some other things.  If you
want all classes to exhibit this behaviour, the simpliest case would be to:
1) define an appender for your app.log file
2) define an appender for your cumul.log file with an attached
LevelMatchFilter.
3) attach both these appenders to rootLogger.

HTH


|-Original Message-
|From: De Moor Dries [mailto:[EMAIL PROTECTED]
|Sent: Thursday, April 03, 2003 8:21 AM
|To: '[EMAIL PROTECTED]'
|Subject: Logging from same class to 2 different log files and each
|configu red with its own level
|
|
|Hello,
|
|In the application I'm writing I need to log 2 things. 
|First of all information to a log file called app.log ( 
|ERROR, DEBUG, INFO,
|... )
|Secondly I have to log some information into a file 
|cumul.log  ( only INFO)
|
|I thought to  define 2 separate property files bu I think 
|this won't work.
|I might be better to define two appenders but how to set 
|the log levels. 
|And how to prevent that ERROR, DEBUG INFO log messages end 
|up in the
|CUMUL.log file.
|
|
|Any advice on this topic. Maybe I'm totally wrong?
|
|
|Kind regards,
|
|
|Dries
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4jme

2003-03-12 Thread Ebersole, Steven
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, try using a copy of the same config file, but
running a replace/ task on it.

HTH


|-Original Message-
|From: fhunter [mailto:[EMAIL PROTECTED]
|Sent: Thursday, March 13, 2003 12:30 AM
|To: 'Log4J Users List'
|Subject: RE: Log4jme
|
|
|Thanks Yoav, 
|
|We tried that and no luck. We'll keep trying!
|
|
|
|-Original Message-
|From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
|Sent: Wednesday, March 12, 2003 12:15 PM
|To: Log4J Users List
|Subject: RE: Log4jme
|
|
|Howdy,
|Assigning an appender named myLogFile and threshold level INFO to
|category name A.B.C.D is easy:
|log4j.logger.A.B.C.D = myLogFile, INFO
|
|Besides that, I can't help you much, as I haven't used 
|log4me at all and
|I don't know how active it is.  I'd say the fact there's 
|no Logger class
|indicates a serious lag in the development of log4me 
|compared to the
|main log4j package.
|
|Yoav Shapira
|Millennium ChemInformatics
|
|
|-Original Message-
|From: fhunter [mailto:[EMAIL PROTECTED]
|Sent: Thursday, March 13, 2003 1:04 AM
|To: 'Log4J Users List'
|Subject: Log4jme
|
|Hi,
|
|We are trying to use log4jme for a j2me version of our 
|application (The
|full version uses log4j successfully) we simply use the log4jme
|executable in place of log4j. We can not use Logger class 
|as log4jme
|does not define Logger class. Instead we use Category as:
|
|m_log = Category.getInstance( ourMain.class.getName() );
|
|Again all works fine on the full version. However the 
|j2me version is
|giving us a No appenders Found for Category ... ;
|
|Note we are using the file appender which is supported by both
|versions.
|
|Any ideas on why these two packages would behave 
|differently. Also is
|there any place where we can find a manual or documentation for
|log4jme?
|
|How can we specifically assign a appender to a Category? 
|Can this be
|done in the properties file?
|
|Thanks you
|
|
|
|
|--
|---
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: 
|[EMAIL PROTECTED]
|
|
|
|
|This e-mail, including any attachments, is a confidential business
|communication, and may contain information that is confidential,
|proprietary and/or privileged.  This e-mail is intended 
|only for the
|individual(s) to whom it is addressed, and may not be 
|saved, copied,
|printed, disclosed or used by anyone else.  If you are not the(an)
|intended recipient, please immediately delete this e-mail from your
|computer system and notify the sender.  Thank you.
|
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|
|
|
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4jme

2003-03-12 Thread Ebersole, Steven
unsubscribe from this mailing list on the Apache Jakarta site


|-Original Message-
|From: He Jennifer-fjh005 [mailto:[EMAIL PROTECTED]
|Sent: Wednesday, March 12, 2003 1:48 PM
|To: 'Log4J Users List'
|Subject: RE: Log4jme
|
|
|hello all, can you guys tell me how to exit this email group?
|
|Thanks
|
|Jennifer
|
|-Original Message-
|From: fhunter [mailto:[EMAIL PROTECTED]
|Sent: Thursday, March 13, 2003 1:38 AM
|To: 'Log4J Users List'
|Subject: RE: Log4jme
|
|
|Ok, that got us a bit closer. 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, 2003 1:16 PM
|To: 'Log4J Users List'
|Subject: RE: Log4jme
|
|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, try using a copy of the same 
|config file, but
|running a replace/ task on it.
|
|HTH
|
|
||-Original Message-
||From: fhunter [mailto:[EMAIL PROTECTED]
||Sent: Thursday, March 13, 2003 12:30 AM
||To: 'Log4J Users List'
||Subject: RE: Log4jme
||
||
||Thanks Yoav, 
||
||We tried that and no luck. We'll keep trying!
||
||
||
||-Original Message-
||From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
||Sent: Wednesday, March 12, 2003 12:15 PM
||To: Log4J Users List
||Subject: RE: Log4jme
||
||
||Howdy,
||Assigning an appender named myLogFile and threshold 
|level INFO to
||category name A.B.C.D is easy:
||log4j.logger.A.B.C.D = myLogFile, INFO
||
||Besides that, I can't help you much, as I haven't used 
||log4me at all and
||I don't know how active it is.  I'd say the fact there's 
||no Logger class
||indicates a serious lag in the development of log4me 
||compared to the
||main log4j package.
||
||Yoav Shapira
||Millennium ChemInformatics
||
||
||-Original Message-
||From: fhunter [mailto:[EMAIL PROTECTED]
||Sent: Thursday, March 13, 2003 1:04 AM
||To: 'Log4J Users List'
||Subject: Log4jme
||
||Hi,
||
||We are trying to use log4jme for a j2me version of our 
||application (The
||full version uses log4j successfully) we simply use 
|the log4jme
||executable in place of log4j. We can not use Logger class 
||as log4jme
||does not define Logger class. Instead we use Category as:
||
||m_log = Category.getInstance( ourMain.class.getName() );
||
||Again all works fine on the full version. However the 
||j2me version is
||giving us a No appenders Found for Category ... ;
||
||Note we are using the file appender which is 
|supported by both
||versions.
||
||Any ideas on why these two packages would behave 
||differently. Also is
||there any place where we can find a manual or 
|documentation for
||log4jme?
||
||How can we specifically assign a appender to a Category? 
||Can this be
||done in the properties file?
||
||Thanks you
||
||
||
||
||--
||---
||To unsubscribe, e-mail: 
|[EMAIL PROTECTED]
||For additional commands, e-mail: 
||[EMAIL PROTECTED]
||
||
||
||
||This e-mail, including any attachments, is a 
|confidential business
||communication, and may contain information that is 
|confidential,
||proprietary and/or privileged.  This e-mail is intended 
||only for the
||individual(s) to whom it is addressed, and may not be 
||saved, copied,
||printed, disclosed or used by anyone else.  If you 
|are not the(an)
||intended recipient, please immediately delete this 
|e-mail from your
||computer system and notify the sender.  Thank you.
||
||
||---
||--
||To unsubscribe, e-mail: 
|[EMAIL PROTECTED]
||For additional

RE: Log4jme

2003-03-12 Thread Ebersole, Steven
The same place you subscribed:
http://jakarta.apache.org/site/mail2.html#log4j



|-Original Message-
|From: He Jennifer-fjh005 [mailto:[EMAIL PROTECTED]
|Sent: Wednesday, March 12, 2003 2:23 PM
|To: 'Log4J Users List'
|Subject: RE: Log4jme
|
|
|can you tell 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
|
|
||-Original Message-
||From: He Jennifer-fjh005 [mailto:[EMAIL PROTECTED]
||Sent: Wednesday, March 12, 2003 1:48 PM
||To: 'Log4J Users List'
||Subject: RE: Log4jme
||
||
||hello all, can you guys tell me how to exit this email group?
||
||Thanks
||
||Jennifer
||
||-Original Message-
||From: fhunter [mailto:[EMAIL PROTECTED]
||Sent: Thursday, March 13, 2003 1:38 AM
||To: 'Log4J Users List'
||Subject: RE: Log4jme
||
||
||Ok, that got us a bit closer. 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, 2003 1:16 PM
||To: 'Log4J Users List'
||Subject: RE: Log4jme
||
||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, try using a copy of the same 
||config file, but
||running a replace/ task on it.
||
||HTH
||
||
|||-Original Message-
|||From: fhunter [mailto:[EMAIL PROTECTED]
|||Sent: Thursday, March 13, 2003 12:30 AM
|||To: 'Log4J Users List'
|||Subject: RE: Log4jme
|||
|||
|||Thanks Yoav, 
|||
|||We tried that and no luck. We'll keep trying!
|||
|||
|||
|||-Original Message-
|||From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
|||Sent: Wednesday, March 12, 2003 12:15 PM
|||To: Log4J Users List
|||Subject: RE: Log4jme
|||
|||
|||Howdy,
|||Assigning an appender named myLogFile and threshold 
||level INFO to
|||category name A.B.C.D is easy:
|||log4j.logger.A.B.C.D = myLogFile, INFO
|||
|||Besides that, I can't help you much, as I haven't used 
|||log4me at all and
|||I don't know how active it is.  I'd say the fact there's 
|||no Logger class
|||indicates a serious lag in the development of log4me 
|||compared to the
|||main log4j package.
|||
|||Yoav Shapira
|||Millennium ChemInformatics
|||
|||
|||-Original Message-
|||From: fhunter [mailto:[EMAIL PROTECTED]
|||Sent: Thursday, March 13, 2003 1:04 AM
|||To: 'Log4J Users List'
|||Subject: Log4jme
|||
|||Hi,
|||
|||We are trying to use log4jme for a j2me version of our 
|||application (The
|||full version uses log4j successfully) we simply use 
||the log4jme
|||executable in place of log4j. We can not use 
|Logger class 
|||as log4jme
|||does not define Logger class. Instead we use 
|Category as:
|||
|||m_log = Category.getInstance( ourMain.class.getName() );
|||
|||Again all works fine on the full version. However the 
|||j2me version is
|||giving us a No appenders Found for Category ... ;
|||
|||Note we are using the file appender which is 
||supported by both
|||versions.
|||
|||Any ideas on why these two packages would behave 
|||differently. Also is
|||there any place where we can find a manual or 
||documentation for
|||log4jme?
|||
|||How can we specifically assign a appender

RE: Duplicate messages, help with log4j.properties

2003-03-07 Thread Ebersole, Steven
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 globally, you can specify additivity on the
rootLogger (that additivity setting is then inherited by all loggers
defined under it).  I.E.,
log4j.rootLogger=DEBUG, daily
log4j.additivity.rootLogger=false
log4j.appender.daily=org.apache.log4j.DailyRollingFileAppender


Also, even without setting it on the rootLogger, you would not need to do
this for each and every class.  Say you are using beanutils, as it appears
you are, then just include settings for the package level as such:
log4j.category.org.apache.commons.beanutils=WARN,daily
log4j.additivity.org.apache.commons.beanutils=false

That way you can also turn off logging all together for the beanutils
package just by doing:
log4j.category.org.apache.commons.beanutils=OFF
log4j.additivity.org.apache.commons.beanutils=false

Check out the log4j short manual
(http://jakarta.apache.org/log4j/docs/manual.html), especially the sections
on logger-hierarchies and appender-additivity.

HTH



|-Original Message-
|From: Wendy Smoak [mailto:[EMAIL PROTECTED]
|Sent: Thursday, March 06, 2003 5:20 PM
|To: Log4J Users List
|Subject: Duplicate messages, help with log4j.properties
|
|
|
|My log4j.properties file is getting huge, and I'm sure I'm 
|not doing this in
|the most efficient way.  Basically, I have a Struts webapp 
|running under
|Tomcat, and I put a log4j.properties file sitting in 
|WEB-INF/classes.
|
|I was immediately deluged with duplicate messages.  There 
|are many posts
|about this in the archives, and some mention 'additivity' 
|which I read up
|on.  But the only way I found to make them go away is to 
|do this for every
|class:
|
|  
|log4j.category.org.apache.commons.beanutils.BeanUtils=WARN,daily   
|  log4j.additivity.org.apache.commons.beanutils.BeanUtils=false
|
|  log4j.category.edu.asu.vpia.struts.ReminderForm=DEBUG, daily
|  log4j.additivity.edu.asu.vpia.struts.ReminderForm=false
|
|Is there a way to set the additivity globally so I don't 
|have to set it for
|each class?  
|
|I'm not really sure why there are two of every message to 
|begin with.  I've
|only defined one appender:
|
|  log4j.rootLogger=DEBUG, daily
|  log4j.appender.daily=org.apache.log4j.DailyRollingFileAppender
|
|I'm guessing that something in the Tomcat/Struts code is 
|seeing my
|log4j.properties file and using it.
|
|Thanks for any advice,
|
|-- 
|Wendy Smoak
|Applications Systems Analyst, Sr.
|Arizona State University PA Information Resources Management
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how to configure LOG4J in weblogic

2003-03-05 Thread Ebersole, Steven
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 even
appserver specific):
1) Put log4j.jar _somewhere_ in the classpath.  Of course somewhere here
must take into account the scope you want that config to have
2) Start weblogic with a -D option for log4j.configuration pointed to your
config file




|-Original Message-
|From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
|Sent: Wednesday, March 05, 2003 3:21 AM
|To: [EMAIL PROTECTED]
|Subject: how to configure LOG4J in weblogic
|
|
|Hi
|was trying to configure log4J in weblogic .is there a 
|handy resource i could use.
|Also i needed to know that when you start weblogic is 
|there a way i can direct it to the properties file ??
|Regards
|Alan
|
|==
|Alan Andrade
|Programmer Analyst
|Mastek Ltd
|[EMAIL PROTECTED]
|
|==
|
|
|MASTEK
|Investing in relationships
|In the US, we're called MAJESCO
|
|~~~
|~~~
|Opinions expressed in this e-mail are those of the 
|individual and not that of Mastek Limited, unless 
|specifically indicated to that effect. Mastek Limited does 
|not accept any responsibility or liability for it. This 
|e-mail and attachments (if any) transmitted with it are 
|confidential and/or privileged and solely for the use of 
|the intended person or entity to which it is addressed. 
|Any review, re-transmission, dissemination or other use of 
|or taking of any action in reliance upon this information 
|by persons or entities other than the intended recipient 
|is prohibited. This e-mail and its attachments have been 
|scanned for the presence of computer viruses. It is the 
|responsibility of the recipient to run the virus check on 
|e-mails and attachments before opening them. If you have 
|received this e-mail in error, kindly delete this e-mail 
|from all computers.
|~~~
|~~~
|
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Help with Logging (1.2.7)

2003-03-04 Thread Ebersole, Steven
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 JBOSS is catching System.out/System.err and handling
those itself.  Never dealt with JBOSS.  Have you asked this question on
their mailing list?




|-Original Message-
|From: Corbin, James [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, March 04, 2003 10:20 AM
|To: Log4J Users List
|Subject: RE: Help with Logging (1.2.7)
|
|
|
|Thanks for the suggestion.  I already have all loggers 
|additivity set to
|false, but my logging to the category still is appended to 
|a JBOSS INFO
|message before being displayed.
|
|I must be doing something fundamentally wrong.  Does 
|anyone have a clue?
|
|I've read all the threads about this from the archive.  It 
|has given me some
|insight, but hasn't addressed my issue.
|
|Can somebody explain why I see the following behavior:
|
|JBOSS logging setup to log to console and file.  I define 
|a new category in
|my application logging config file then attach new console 
|and file appender
|to the category.  My application then logs to the 
|category.  If I make the
|following call: myCategory.debug( sometext );
|
|Why does this get appended to a [INFO] message before 
|being displayed to the
|console.  This is not an additivity issue as I only get 
|one entry in the
|log.
|
|If someone could help me understand why I see log entries 
|like the following
|with my setup I might be able to fix it.  Where is the 
|09:20:47,919 INFO
|[STDOUT] coming from  Everything after that is the 
|data from my call to
|log to the category.
|
|09:20:47,919 INFO  [STDOUT] 09:20:47,919,MyCategory
|[INFO ] -
| setSuccessfulForward = /SendHouseList
|
|
|-Original Message-
|From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
|Sent: Tuesday, March 04, 2003 7:13 AM
|To: Log4J Users List
|Subject: RE: Help with Logging (1.2.7)
|
|
|Howdy,
|Set additivity to false for all your loggers, or 
|alternatively for the
|root logger.
|
|Yoav Shapira
|Millennium ChemInformatics
|
|
|-Original Message-
|From: Corbin, James [mailto:[EMAIL PROTECTED]
|Sent: Monday, March 03, 2003 6:30 PM
|To: Log4J Users List
|Subject: RE: Help with Logging (1.2.7)
|
|
|That would work, but I forgot to mention that our application is
|deployed
|on
|multiple server vendors and not just JBOSS.  If it were, I would
|definitely
|not need to have a application specific configuration file.
|
|J.D.
|
|-Original Message-
|From: Rafal Kedziorski [mailto:[EMAIL PROTECTED]
|Sent: Monday, March 03, 2003 4:08 PM
|To: Log4J Users List
|Subject: Re: Help with Logging (1.2.7)
|
|hi,
|
|why don't You use the log4j included to JBoss? I'm 
|working with this
|and it
|works fine.
|
|
|Rafal
|
|At 16:39 03.03.2003 -0500, Corbin, James wrote:
|
|I am using Log4j version 1.2.7 as my application logging 
|framework
|running
|on a JBOSS app server.
|
|The only issue I have run into is trying to define a separate
|configuration
|file that when loaded doesn't interfere with the one 
|loaded at server
|startup by JBOSS.  Therefore, I created the following 
|configuration
|file
|which creates a category and my application logs to the category.
|This
|works as I've mentioned in previous emails, but the console log
|appends my
|messages to an INFO message (from JBOSS configuration?).  I've
|included a
|log entry to demonstrate my issue:
|
|14:36:14,648 INFO  [STDOUT] 14:36:14,648,LightSpeed  
|  [DEBUG] -
|some
|message text
|
|My category name is LightSpeed.  Notice how the [DEBUG] 
|message is
|appended
|to a INFO [STDOUT] message?  I assume this is coming 
|from the JBOSS
|configuration of Log4j.
|
|Application Specific Configuration File *
|
|## The server.log file appender for LightSpeed
|log4j.category.LightSpeed=DEBUG, LightSpeed_Console,
|LightSpeed_Default
|log4j.additivity.LightSpeed=false;
|log4j.appender.LightSpeed_Default=org.apache.log4j.Rollin
|gFileAppender
|log4j.appender.LightSpeed_Default.File=server.log
|log4j.appender.LightSpeed_Default.MaxFileSize=500KB
|log4j.appender.LightSpeed_Default.MaxBackupIndex=1
|log4j.appender.LightSpeed_Default.layout=org.apache.log4j
|.PatternLayou
|t

RE: Help with Logging (1.2.7)

2003-03-04 Thread Ebersole, Steven
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, 2003 10:50 AM
|To: 'Log4J Users List'
|Subject: RE: Help with Logging (1.2.7)
|
|
|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 JBOSS is catching 
|System.out/System.err and handling
|those itself.  Never dealt with JBOSS.  Have you asked 
|this question on
|their mailing list?
|
|
|
|
||-Original Message-
||From: Corbin, James [mailto:[EMAIL PROTECTED]
||Sent: Tuesday, March 04, 2003 10:20 AM
||To: Log4J Users List
||Subject: RE: Help with Logging (1.2.7)
||
||
||
||Thanks for the suggestion.  I already have all loggers 
||additivity set to
||false, but my logging to the category still is appended to 
||a JBOSS INFO
||message before being displayed.
||
||I must be doing something fundamentally wrong.  Does 
||anyone have a clue?
||
||I've read all the threads about this from the archive.  It 
||has given me some
||insight, but hasn't addressed my issue.
||
||Can somebody explain why I see the following behavior:
||
||JBOSS logging setup to log to console and file.  I define 
||a new category in
||my application logging config file then attach new console 
||and file appender
||to the category.  My application then logs to the 
||category.  If I make the
||following call: myCategory.debug( sometext );
||
||Why does this get appended to a [INFO] message before 
||being displayed to the
||console.  This is not an additivity issue as I only get 
||one entry in the
||log.
||
||If someone could help me understand why I see log entries 
||like the following
||with my setup I might be able to fix it.  Where is the 
||09:20:47,919 INFO
||[STDOUT] coming from  Everything after that is the 
||data from my call to
||log to the category.
||
||09:20:47,919 INFO  [STDOUT] 09:20:47,919,MyCategory
||[INFO ] -
|| setSuccessfulForward = /SendHouseList
||
||
||-Original Message-
||From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
||Sent: Tuesday, March 04, 2003 7:13 AM
||To: Log4J Users List
||Subject: RE: Help with Logging (1.2.7)
||
||
||Howdy,
||Set additivity to false for all your loggers, or 
||alternatively for the
||root logger.
||
||Yoav Shapira
||Millennium ChemInformatics
||
||
||-Original Message-
||From: Corbin, James [mailto:[EMAIL PROTECTED]
||Sent: Monday, March 03, 2003 6:30 PM
||To: Log4J Users List
||Subject: RE: Help with Logging (1.2.7)
||
||
||That would work, but I forgot to mention that our 
|application is
||deployed
||on
||multiple server vendors and not just JBOSS.  If it 
|were, I would
||definitely
||not need to have a application specific configuration file.
||
||J.D.
||
||-Original Message-
||From: Rafal Kedziorski [mailto:[EMAIL PROTECTED]
||Sent: Monday, March 03, 2003 4:08 PM
||To: Log4J Users List
||Subject: Re: Help with Logging (1.2.7)
||
||hi,
||
||why don't You use the log4j included to JBoss? I'm 
||working with this
||and it
||works fine.
||
||
||Rafal
||
||At 16:39 03.03.2003 -0500, Corbin, James wrote:
||
||I am using Log4j version 1.2.7 as my application logging 
||framework
||running
||on a JBOSS app server.
||
||The only issue I have run into is trying to define 
|a separate
||configuration
||file that when loaded doesn't interfere with the one 
||loaded at server
||startup by JBOSS.  Therefore, I created the following 
||configuration
||file
||which creates a category and my application logs to 
|the category.
||This
||works as I've mentioned in previous emails

RE: Help with Logging (1.2.7)

2003-03-04 Thread Ebersole, Steven
But what String did you pass to the println method to get that output?  If
you just simply did 'System.out.println( Key = OTA_HotelResSearchRQ );',
then the result is NOT normal stdout behaviour, and would seem JBOSS is
defintely manually redirecting stdout (plus adding the additional info).


 The logs look identical, both the console and log file.  It is happening
in
both places.

OK, so say you call the logging method:
log.debug( Key = OTA_HotelResSearchRQ );

Then the console shows:
14:36:14,648 INFO  [STDOUT] 14:36:14,648,LightSpeed[DEBUG] - Key =
OTA_HotelResSearchRQ

_AND_
The file server.log has the line:
14:36:14,648 INFO  [STDOUT] 14:36:14,648,LightSpeed[DEBUG] - Key =
OTA_HotelResSearchRQ

???

That just doesn't make any sense.





|-Original Message-
|From: Corbin, James [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, March 04, 2003 10:57 AM
|To: Log4J Users List
|Subject: RE: Help with Logging (1.2.7)
|
|
|
|A System.out.println() logs as I would expect.  Below is a
|System.out.println(), taken from the JBOSS console output.
|
|09:59:16,398 INFO  [STDOUT] Key = OTA_HotelResSearchRQ
|
|J.D.
|
|-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 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, 2003 10:50 AM
||To: 'Log4J Users List'
||Subject: RE: Help with Logging (1.2.7)
||
||
||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 JBOSS is catching 
||System.out/System.err and handling
||those itself.  Never dealt with JBOSS.  Have you asked 
||this question on
||their mailing list?
||
||
||
||
|||-Original Message-
|||From: Corbin, James 
|[mailto:[EMAIL PROTECTED]
|||Sent: Tuesday, March 04, 2003 10:20 AM
|||To: Log4J Users List
|||Subject: RE: Help with Logging (1.2.7)
|||
|||
|||
|||Thanks for the suggestion.  I already have all loggers 
|||additivity set to
|||false, but my logging to the category still is 
|appended to 
|||a JBOSS INFO
|||message before being displayed.
|||
|||I must be doing something fundamentally wrong.  Does 
|||anyone have a clue?
|||
|||I've read all the threads about this from the 
|archive.  It 
|||has given me some
|||insight, but hasn't addressed my issue.
|||
|||Can somebody explain why I see the following behavior:
|||
|||JBOSS logging setup to log to console and file.  
|I define 
|||a new category in
|||my application logging config file then attach 
|new console 
|||and file appender
|||to the category.  My application then logs to the 
|||category.  If I make the
|||following call: myCategory.debug( sometext );
|||
|||Why does this get appended to a [INFO] message before 
|||being displayed to the
|||console.  This is not an additivity issue as I only get 
|||one entry in the
|||log.
|||
|||If someone could help me understand why I see 
|log entries 
|||like the following
|||with my setup I might be able to fix it.  Where is the 
|||09:20:47,919 INFO
|||[STDOUT] coming from  Everything after that is the 
|||data from my call to
|||log to the category.
|||
|||09:20:47,919 INFO  [STDOUT] 
|09:20:47,919,MyCategory
|||[INFO ] -
||| setSuccessfulForward = /SendHouseList
|||
|||
|||-Original Message-
|||From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
|||Sent: Tuesday, March 04, 2003 7:13 AM
|||To: Log4J Users List
|||Subject: RE: Help with Logging (1.2.7

RE: Help with Logging (1.2.7)

2003-03-04 Thread Ebersole, Steven
Sorry, cannot help you there.  As I mentioned I have zero experience using
JBOSS.  For the console one, I would suggest that it really isn't that big
of a deal (but thats just me).  For the file appender, however, I cannot
begin to fathom how they could be catching those.

Might want to ask these on the JBOSS mailing list to see if any over there
have come to terms with this.  At any rate, it definitely seems a JBOSS
issue.



|-Original Message-
|From: Corbin, James [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, March 04, 2003 11:36 AM
|To: Log4J Users List
|Subject: RE: Help with Logging (1.2.7)
|
|
|
|You are correct.
|
|I still would like to be able to define, through my 
|application specific
|configuration file, a console and rolling file appender 
|that doesn't
|conflict with the console and rolling file appender 
|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 PROTECTED] 
|Sent: Tuesday, March 04, 2003 10:20 AM
|To: 'Log4J Users List'
|Subject: RE: Help with Logging (1.2.7)
|
|But what String did you pass to the println method to get 
|that output?  If
|you just simply did 'System.out.println( Key = 
|OTA_HotelResSearchRQ );',
|then the result is NOT normal stdout behaviour, and would 
|seem JBOSS is
|defintely manually redirecting stdout (plus adding the 
|additional info).
|
|
| The logs look identical, both the console and log file. 
| It is happening
|in
|both places.
|
|OK, so say you call the logging method:
|log.debug( Key = OTA_HotelResSearchRQ );
|
|Then the console shows:
|14:36:14,648 INFO  [STDOUT] 14:36:14,648,LightSpeed
|[DEBUG] - Key =
|OTA_HotelResSearchRQ
|
|_AND_
|The file server.log has the line:
|14:36:14,648 INFO  [STDOUT] 14:36:14,648,LightSpeed
|[DEBUG] - Key =
|OTA_HotelResSearchRQ
|
|???
|
|That just doesn't make any sense.
|
|
|
|
|
||-Original Message-
||From: Corbin, James [mailto:[EMAIL PROTECTED]
||Sent: Tuesday, March 04, 2003 10:57 AM
||To: Log4J Users List
||Subject: RE: Help with Logging (1.2.7)
||
||
||
||A System.out.println() logs as I would expect.  Below is a
||System.out.println(), taken from the JBOSS console output.
||
||09:59:16,398 INFO  [STDOUT] Key = OTA_HotelResSearchRQ
||
||J.D.
||
||-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 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, 2003 10:50 AM
|||To: 'Log4J Users List'
|||Subject: RE: Help with Logging (1.2.7)
|||
|||
|||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 JBOSS is catching 
|||System.out/System.err and handling
|||those itself.  Never dealt with JBOSS.  Have you asked 
|||this question on
|||their mailing list?
|||
|||
|||
|||
||||-Original Message-
||||From: Corbin, James 
||[mailto:[EMAIL PROTECTED]
||||Sent: Tuesday, March 04, 2003 10:20 AM
||||To: Log4J Users List
||||Subject: RE: Help with Logging (1.2.7)
||||
||||
||||
||||Thanks for the suggestion.  I already have 
|all loggers 
||||additivity set to
||||false, but my logging to the category still is 
||appended to 
||||a JBOSS INFO
||||message before being displayed

RE: newbie setup question

2003-02-27 Thread Ebersole, Steven
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 a java System property to whatever you want
when starting up your server like -D ORG_APACHE_LOG_LEVEL=warn

HTH



|-Original Message-
|From: John Smith [mailto:[EMAIL PROTECTED]
|Sent: Thursday, February 27, 2003 1:25 AM
|To: [EMAIL PROTECTED]
|Subject: newbie setup question
|
|
|Hi there.  This is probably a simple question but I'll
|post anyway.
|
|In each of my webapp directories I've created I have a
|log4j jar file in WEB-INF/lib and a properties file in
|WEB-INF/classes.
|
|Where would be the best place to set, for example,
|'log4j.logger.org.apache=WARN'?
|
|I would want this to be sort of a global setting.
|
|Thanks ahead of time.
|
|Frank
|
|--
|
|Just to let you know how I have setup log4j here is a
|quick example...
|
|log4j.properties:
|
|log4j.rootLogger=WARN, A1
|
|log4j.appender.A1=org.apache.log4j.RollingFileAppender
|log4j.appender.A1.MaxFileSize=5MB
|log4j.appender.A1.MaxBackupIndex=1
|log4j.appender.A1.File=/web/logs/webapp.log
|
|Then in my class I call:
|
|static Logger logger =
|Logger.getLogger(com.foo.webapp.class);
|
|then proceed with logging.
|
|__
|Do you Yahoo!?
|Yahoo! Tax Center - forms, calculators, tips, more
|http://taxes.yahoo.com/
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: NDC behaviour

2003-02-21 Thread Ebersole, Steven
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 example,
you say When exiting the servlet: NDC.pop();.  Is this done in a finally
block for a try which encompases the entire processing block?  If not, when
an exception occurs, the NDC.pop() will most likely never occur and so the
value that was previously pushed onto the stack will still be there when the
next thread does its push, and so on.  You really need to do this as:

public class MyServlet
extends HttpServlet
{
public doGet( HttpServletRequest req, HttpServletResponse resp )
{
try
{
NDC.push( Client # + ID );
... processing
}
... catches
finally
{
NDC.pop();
}
}
}




|-Original Message-
|From: Nuno Carvalho [mailto:[EMAIL PROTECTED]
|Sent: Friday, February 21, 2003 12:48 PM
|To: [EMAIL PROTECTED]
|Subject: NDC behaviour
|
|
|Hi,
|
|I think I still don't understand the NDC functionality.
|
|Consider that I'm logging information from a Java Servlet. 
|This servlet have several access simultaneously. I would like
|to have a logging information grouped by transactions 
|(i.e. client).
|
|Example:
|
|[Client #12345]: User have entered the site
|[Client #12345]: User is opening the image file
|[Client #12345]: User is quitting the site
|[Client #84937]: User have entered the site
|[Client #84937]: User is opening the image file
|[Client #84937]: User is quitting the site
|
|On this case, even with too much concurrency the log 
|information is grouped by client ID.
|
|Isn't this a task for NDC ?
|
|At the implementation I'm using:
|
|When entering into the servlet: NDC.push(Client #+ID);
|When exiting the servlet: NDC.pop();
|
|Unfortunally, I can't get the required behaviour.
|
|Sometimes I get something like:
|
|[Client #12345 Client #84937 Client #63545]: User have 
|entered the site
|
|Could someone give me a hint ?
|
|Thanks in advance.
|
|Regards,
|Nuno
|
|
|
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: questions related to config xml file

2003-02-07 Thread Ebersole, Steven
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 List'
|Subject: RE: questions related to config xml file
|
|
|Nancy, thanks for the details.  I believe I understand 
|what you are trying
|to do.
|
|Yes, it is possible to restrict the set of logging events 
|sent to the remote
|client by the SocketHubAppender.  And I think this is a 
|very good use of
|SocketHubAppender, btw, given your requirements.
|
|The best method for restricting events that are sent via 
|SocketHubAppender
|(or SocketAppender for that matter) is configuring a 
|filter chain on that
|appender.  You can see the javadoc information on log4j filters at:
|
|http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/s
|pi/Filter.html
|
|And there are few good examples in the varia package:
|
|http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/v
|aria/package-fram
|e.html
|
|But, I have been working on a new package of useful 
|filters for the v1.3
|release.  They are fully compatible with v1.2.X.  If I 
|package them up into
|a jar file, would you be interested in giving them a try?  
|They allow full
|configuration of a filter chain using almost any set of 
|source criteria you
|might want (contents of the message string, contents of 
|the MDC, contents of
|the NDC, level of the logger, etc).
|
|And this invitation is for anyone out there that might be 
|interested.
|
|-Mark
|
| -Original Message-
| From: Nancy [mailto:[EMAIL PROTECTED]]
| Sent: Wednesday, December 11, 2002 11:14 AM
| To: Log4J Users List
| Subject: Re: questions related to config xml file
| 
| 
| Hi,Mark:
| 
| Thank you so much for your reply.
| 
| Sorry for not providing enough information.
| 
| The following is the description of what I am attemping 
|to accomplish:
| We have developed a web application. Now I am developing a 
| swing application
| which is used to monitor some major activities (such as place 
| orders, login,
| logout and etc.) happened in the web application. The 
| connection between the
| swing application and the web application is initialized 
|by the swing
| application(I mean when a system admin clicks the connect 
| button on the
| swing user interface). After the connection is established, 
| whenever users
| login, logout, or place orders in the web application, the 
| swing application
| should IMMEDIATELY detects them, and display the appropriate 
| message(Such as
| user has place an order, user has login the web site). 
| After doing some
| study on log4j api, we decided to use SocketHubAppender 
|in the web
| application to accomplish the senario.
| 
| 
| I am using xml formate to config the configuration file. The 
| following is
| what I configured in the configuration file: (I omitted the 
| parts that are
| not related to the senario):
| ...
| log4j:configuration 
|xmlns:log4j='http://jakarta.apache.org/log4j/'
|...
|   !-- for Activity monitor purpose.--
| !-- SocketHubAppender does not use a layout--
| 
| appender name=SOCKET_HUB
| class=org.apache.log4j.net.SocketHubAppender
|param name=Port value=7001/
| /appender
| 
| root
| 
| !-- for Activity monitor purpose. --
|   appender-ref ref=SOCKET_HUB /
| /root
| 
| /log4j:configuration
| 
| 
| Question1:   What else do I need to config in the
| configuration file?
| Question2:I ONLY want SOME activities to use
| SocketHubAppender,  for instance, activities such as login, 
| logout, place
| orders. How should I do to limit the use of SocketHubAppender 
| only to those
| activities? We have already used logging mechnism for ALL 
| activities for
| general logging purpose(such as logging to file systems, 
| console), and we
| prefer those general logging still exist while add the use 
| SocketHubAppender
| for some activities.
| 
| I tried my best to make the senario and the questions clear. 
| However,  I am
| very glad to explain them in more detail  if you have 
|any confuse.
| 
| Thank you very much for your reply.
| 
| Best regards,
| 
| Nancy
| 
| 
| 
| 
| - Original Message -
| From: Mark Womack [EMAIL PROTECTED]
| To: 'Log4J Users List' [EMAIL PROTECTED]
| Sent: Thursday, 

RE: log4j + j2ee error

2003-02-06 Thread Ebersole, Steven
Of course; because it is defined as transient it does not get serialized
during object serialization and thus cannot be deserialized during object
deserialization.  There are two ways of handling this:

1) Does this really need to be an instance variable?  In other words can
this not be a static variable?  Based on the fact that you are obtaining the
Category using the class name, my guess is that log does not need to be an
instance variable.  If this is the case, then simply define the variable as
static.

2) If it does need to be an instance variable, then you will need to either:
a) move the Category.getInstance() call inside the constructor (because the
constructor is called during deserialization); or 
b) wrap access to the Category instance inside a method call



|-Original Message-
|From: Sandeep Dixit [mailto:[EMAIL PROTECTED]]
|Sent: Thursday, February 06, 2003 11:22 AM
|To: 'Log4J Users List'
|Subject: RE: log4j + j2ee error
|
|
|Although the error message has disappeared, problem with 
|log4j still persists. In EmployeeVO, I am calling 
|log.debug(..) in the exception and it is throwing null 
|pointer exception, i.e., 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
|To:'Log4J Users List'
|Subject:   RE: log4j + j2ee error
|
|Logger is the name of the newer class which replaced 
|Category.  The issue is
|the same for both of them, however.
|
|At some point in your application, the server needs to 
|return data back to
|the client (typically in J2EE apps this is accomplished 
|with ValueObjects or
|DataTransferObjects depending on your preferred patterns 
|catalog).  That
|server return will be serialized for transport back to the 
|client (actually
|for transport back to the client stub, which then 
|deserializes it for the
|calling client).
|
|So in your set up, I am guessing that ValueObjectFactory 
|is returning a
|collection of a class named like EmployeeVO.  If this 
|collection is then
|sent back to the client and the EmployeeVO instances 
|making up the elements
|of that collection define a Logger (or Category) instance, 
|the serialization
|will fail because Logger/Category is not serializable.  
|You would need to
|mark the Logger/Category variable on the EmployeeVO class 
|as transient.
|
|
|So if you have:
|public class EmployeeVO
|{
|private Category log = Category.getInstance( getClass() );
|...
|}
|
|change to:
|public class EmployeeVO
|{
|private transient Category log = Category.getInstance( 
|getClass() );
|...
|}
|
|
|
|
|
||-Original Message-
||From: Sandeep Dixit [mailto:[EMAIL PROTECTED]]
||Sent: Wednesday, February 05, 2003 3:12 PM
||To: 'Log4J Users List'
||Subject: RE: log4j + j2ee error
||
||
||Well. I am not sure about Looger variable. I am using 
||
||private Category log = Category.getInstance(getClass());
||
||statement in the OrganizationManager session bean. Log4j 
||initialization is done successfully in the view controller 
||servlet. This error occurs when the 
||findColOfEmployeeVOByLoginInfo method of the 
||OrganizationManager session bean is called. 
||
|| method ***
||  public Collection findColOfEmployeeVOByLoginInfo(String 
||username, String password) throws SessionException, 
||RemoteException {
||  try {
||  EmployeeHome home = (EmployeeHome)
||  
||ServiceLocatorBean.getInstance().getLocalHome(
||  ejb/Employee, 
||EmployeeHome.class);
||
||  return 
||ValueObjectFactory.getInstance().getCollectionOfVO(
||  
||home.findByLoginInfo(username, password));
||  } catch (Exception re) {
||  throw new 
||SessionException(this.getClass().getName()+.findByLoginInf
||o():+re.getMessage());
||  }
||  }
||***
||The method getCollectionOfVO gets the EJB interface 
||objects and then copies values into JavaBean objects and 
||returns a collection of JavaBean objects. Both EJB and 
||JavaBean have 
||
||- private Category log = Category.getInstance(getClass

RE: log4j + j2ee error

2003-02-06 Thread Ebersole, Steven
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)
{
log.error(...);
}
}
}


2)
public class EmployeeVO implements java.io.Serializable
{
private transient Category log;

...

public EmployeeVO()
{
log = Category.getInstance( getClass() );
}

public getName()
{
try
{
...
}
catch(Exception e)
{
log.error(...);
}
}
}


Of course, option #2 is only really of value if retreival of a Category for
variable log is based on some type of per-instance data.



|-Original Message-
|From: Sandeep Dixit [mailto:[EMAIL PROTECTED]]
|Sent: Thursday, February 06, 2003 12:03 PM
|To: '[EMAIL PROTECTED]'; 
|'[EMAIL PROTECTED]'
|Subject: RE: log4j + j2ee error
|
|
|My EmployeeVO valueobject class looks like:
|
|public class EmployeeVO implements java.io.Serializable
|{
|private transient Category log = Category.getInstance( 
|getClass() );
|...
|
|   public getName() {
|   try {
|   ...
|   } catch(Exception e) {
|   log.error(...);
|   }
|}
|
|- Sandeep
|
|--
|From:  Martin Gainty
|Sent:  Thursday, February 06, 2003 12:34 PM
|To:[EMAIL PROTECTED]
|Cc:[EMAIL PROTECTED]
|Subject:   RE: log4j + j2ee error
|
|File: ATT00032.html
|
|---
|Incoming mail is certified Virus Free.
|Checked by AVG anti-virus system (http://www.grisoft.com).
|Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/03
|
|
|
|---
|Outgoing mail is certified Virus Free.
|Checked by AVG anti-virus system (http://www.grisoft.com).
|Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/03
| 
|
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: log4j + j2ee error

2003-02-06 Thread Ebersole, Steven
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'; '[EMAIL PROTECTED]'
|Subject: RE: log4j + j2ee error
|
|
|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)
|{
|log.error(...);
|}
|}
|}
|
|
|2)
|public class EmployeeVO implements java.io.Serializable
|{
|private transient Category log;
|
|...
|
|public EmployeeVO()
|{
|log = Category.getInstance( getClass() );
|}
|
|public getName()
|{
|try
|{
|...
|}
|catch(Exception e)
|{
|log.error(...);
|}
|}
|}
|
|
|Of course, option #2 is only really of value if retreival 
|of a Category for
|variable log is based on some type of per-instance data.
|
|
|
||-Original Message-
||From: Sandeep Dixit [mailto:[EMAIL PROTECTED]]
||Sent: Thursday, February 06, 2003 12:03 PM
||To: '[EMAIL PROTECTED]'; 
||'[EMAIL PROTECTED]'
||Subject: RE: log4j + j2ee error
||
||
||My EmployeeVO valueobject class looks like:
||
||public class EmployeeVO implements java.io.Serializable
||{
||private transient Category log = Category.getInstance( 
||getClass() );
||...
||
||  public getName() {
||  try {
||  ...
||  } catch(Exception e) {
||  log.error(...);
||  }
||}
||
||- Sandeep
||
||--
||From: Martin Gainty
||Sent: Thursday, February 06, 2003 12:34 PM
||To:   [EMAIL PROTECTED]
||Cc:   [EMAIL PROTECTED]
||Subject:  RE: log4j + j2ee error
||
||File: ATT00032.html
||
||---
||Incoming mail is certified Virus Free.
||Checked by AVG anti-virus system (http://www.grisoft.com).
||Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/03
||
||
||
||---
||Outgoing mail is certified Virus Free.
||Checked by AVG anti-virus system (http://www.grisoft.com).
||Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/03
|| 
||
||
||---
||--
||To unsubscribe, e-mail: 
|[EMAIL PROTECTED]
||For additional commands, e-mail: 
|[EMAIL PROTECTED]
||
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: log4j + j2ee error

2003-02-05 Thread Ebersole, Steven
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.



|-Original Message-
|From: Sandeep Dixit [mailto:[EMAIL PROTECTED]]
|Sent: Wednesday, February 05, 2003 2:40 PM
|To: '[EMAIL PROTECTED]'
|Subject: log4j + j2ee error
|
|
|I am getting following error message while attempting to 
|use log4j with J2ee 1.3.1. Any help would be appreciated.
|
|Thanks,
|Sandeep
|
|
|J2EE server startup complete.
|Before call to PropertyConfigurator
|After call to PropertyConfigurator
|Exception in thread HttpProcessor[8000][3] 
|org.omg.CORBA.BAD_PARAM: org.apache
|.log4j.Category  vmcid: OMG  minor code: 6 completed: Maybe
|at 
|com.sun.corba.se.internal.util.Utility.throwNotSerializable
|ForCorba(U
|tility.java:1018)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectFi
|eld(IIOPOu
|tputStream.java:652)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFi
|elds(IIOPO
|utputStream.java:706)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteO
|bjectDeleg
|ate(IIOPOutputStream.java:165)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(
|IIOPOutput
|Stream.java:496)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteOb
|ject(IIOPO
|utputStream.java:122)
|at 
|com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInt
|ernal(Valu
|eHandlerImpl.java:136)
|at 
|com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(Va
|lueHandler
|Impl.java:116)
|at 
|com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_va
|lue(CDROut
|putStream_1_0.java:1049)
|at 
|com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_ab
|stract_int
|erface(CDROutputStream_1_0.java:626)
|at 
|com.sun.corba.ee.internal.iiop.CDROutputStream.write_abstra
|ct_interfa
|ce(CDROutputStream.java:281)
|at 
|com.sun.corba.ee.internal.javax.rmi.CORBA.Util.writeAbstrac
|tObject(Ut
|il.java:145)
|at javax.rmi.CORBA.Util.writeAbstractObject(Util.java:129)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectDe
|legate(IIO
|POutputStream.java:96)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectOv
|erride(IIO
|POutputStream.java:103)
|at 
|java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:274)
|at java.util.HashSet.writeObject(HashSet.java:248)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.writeObject(N
|ative Meth
|od)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.invokeObjectW
|riter(IIOP
|OutputStream.java:526)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(
|IIOPOutput
|Stream.java:493)
|at 
|com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteOb
|ject(IIOPO
|utputStream.java:122)
|at 
|com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInt
|ernal(Valu
|eHandlerImpl.java:136)
|at 
|com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(Va
|lueHandler
|Impl.java:116)
|at 
|com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_va
|lue(CDROut
|putStream_1_0.java:1049)
|at 
|com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(
|CDROutputS
|tream.java:264)
|at 
|com.sun.corba.ee.internal.javax.rmi.CORBA.Util.copyObject(U
|til.java:5
|67)
|at javax.rmi.CORBA.Util.copyObject(Util.java:314)
|at 
|com.ohioedge.j2ee.api.org.ejb._OrganizationManager_Stub.fin
|dColOfEmpl
|oyeeVOByLoginInfo(Unknown Source)
|at 
|com.ohioedge.j2ee.fnd.SessionBean.findByLoginInfo(Unknown Source)
|at 
|org.j2eebuilder.view.SessionImpl.processRequest(Unknown Source)
|at org.apache.jsp.Home$jsp._jspService(Home$jsp.java:166)
|at 
|org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
|at 
|javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
|at 
|org.apache.jasper.servlet.JspServlet$JspServletWrapper.serv
|ice(JspSer
|vlet.java:202)
|at 
|org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServ
|let.java:3
|82)
|at 
|org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
|at 

RE: log4j + j2ee error

2003-02-05 Thread Ebersole, Steven
Logger is the name of the newer class which replaced Category.  The issue is
the same for both of them, however.

At some point in your application, the server needs to return data back to
the client (typically in J2EE apps this is accomplished with ValueObjects or
DataTransferObjects depending on your preferred patterns catalog).  That
server return will be serialized for transport back to the client (actually
for transport back to the client stub, which then deserializes it for the
calling client).

So in your set up, I am guessing that ValueObjectFactory is returning a
collection of a class named like EmployeeVO.  If this collection is then
sent back to the client and the EmployeeVO instances making up the elements
of that collection define a Logger (or Category) instance, the serialization
will fail because Logger/Category is not serializable.  You would need to
mark the Logger/Category variable on the EmployeeVO class as transient.


So if you have:
public class EmployeeVO
{
private Category log = Category.getInstance( getClass() );
...
}

change to:
public class EmployeeVO
{
private transient Category log = Category.getInstance( getClass() );
...
}





|-Original Message-
|From: Sandeep Dixit [mailto:[EMAIL PROTECTED]]
|Sent: Wednesday, February 05, 2003 3:12 PM
|To: 'Log4J Users List'
|Subject: RE: log4j + j2ee error
|
|
|Well. I am not sure about Looger variable. I am using 
|
|private Category log = Category.getInstance(getClass());
|
|statement in the OrganizationManager session bean. Log4j 
|initialization is done successfully in the view controller 
|servlet. This error occurs when the 
|findColOfEmployeeVOByLoginInfo method of the 
|OrganizationManager session bean is called. 
|
| method ***
|   public Collection findColOfEmployeeVOByLoginInfo(String 
|username, String password) throws SessionException, 
|RemoteException {
|   try {
|   EmployeeHome home = (EmployeeHome)
|   
|ServiceLocatorBean.getInstance().getLocalHome(
|   ejb/Employee, 
|EmployeeHome.class);
|
|   return 
|ValueObjectFactory.getInstance().getCollectionOfVO(
|   
|home.findByLoginInfo(username, password));
|   } catch (Exception re) {
|   throw new 
|SessionException(this.getClass().getName()+.findByLoginInf
|o():+re.getMessage());
|   }
|   }
|***
|The method getCollectionOfVO gets the EJB interface 
|objects and then copies values into JavaBean objects and 
|returns a collection of JavaBean objects. Both EJB and 
|JavaBean have 
|
|- private Category log = Category.getInstance(getClass());
|
|defined in them. But the variable log is not copied. 
|
|Thanks,
|Sandeep
|
|
|
|--
|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 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.
|
|
|
||-Original Message-
||From: Sandeep Dixit [mailto:[EMAIL PROTECTED]]
||Sent: Wednesday, February 05, 2003 2:40 PM
||To: '[EMAIL PROTECTED]'
||Subject: log4j + j2ee error
||
||
||I am getting following error message while attempting to 
||use log4j with J2ee 1.3.1. Any help would be appreciated.
||
||Thanks,
||Sandeep
||
||
||J2EE server startup complete.
||Before call to PropertyConfigurator
||After call to PropertyConfigurator
||Exception in thread HttpProcessor[8000][3] 
||org.omg.CORBA.BAD_PARAM: org.apache
||.log4j.Category  vmcid: OMG  minor code: 6 completed: Maybe
||at 
||com.sun.corba.se.internal.util.Utility.throwNotSerializable
||ForCorba(U
||tility.java:1018)
||at 
||com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectFi
||eld(IIOPOu
||tputStream.java:652)
||at 
||com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFi
||elds(IIOPO
||utputStream.java:706)
||at 
||com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteO
||bjectDeleg
||ate(IIOPOutputStream.java:165)
||at 
||com.sun.corba.se.internal.io.IIOPOutputStream.outputObject

RE: How to truncate characters in the layout of priority

2003-02-03 Thread Ebersole, Steven
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 always use %5p.
|
|[]'s
|Daniel Serodio
|
|On Mon, 2003-02-03 at 13:17, Abramson, Rami wrote:
| Have tried it and it does not work.
| Have you tried it?
| 
|  thank you,
| 
|  Rami
| 
| -Original Message-
| From: Daniel Serodio [mailto:[EMAIL PROTECTED]]
| Sent: Monday, February 03, 2003 3:47 PM
| To: Log4J Users List
| Subject: Re: How to truncate characters in the layout of priority
| 
| 
| Use %3p for the first 3 characters of the priority.
| 
| []'s
| Daniel Serodio
| 
| On Mon, 2003-02-03 at 11:43, Abramson, Rami wrote:
|  Hello,
|  
|  How is it possible in the property file to define a 
|layout that outputs
| only
|  the first 3 characters of the priority?
|  
|  Output lines for example,
|  
|  DEB This is a test of DEBUG...
|  FAT  This is a test of FATAL...
|  
|  Instead of receiving,
|  DEBUG This is a test of DEBUG...
|  FATAL  This is a test of FATAL...
|  
|  if we use:
|  log4j.appender.dest1.layout.ConversionPattern=%-5p %m%n
|  
| thank you,
|  
|Rami A.
|   
|  
|  
|---
|--
|  To unsubscribe, e-mail: 
|[EMAIL PROTECTED]
|  For additional commands, e-mail: 
|[EMAIL PROTECTED]
|-- 
|Daniel Serodio [EMAIL PROTECTED]
|CheckForte
|
|
|---
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: NOONE TO ANSWER ? sorry for the previous mail

2003-01-29 Thread Ebersole, Steven
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 mentioned to tell
you how to set them up.





|-Original Message-
|From: Ashraf Fouad [mailto:[EMAIL PROTECTED]]
|Sent: Wednesday, January 29, 2003 7:12 AM
|To: Log4J Users List
|Subject: RE: NOONE TO ANSWER ? sorry for the previous mail
|
|
|Thankx too much for the reply
|
|- I'm using Oracle JDeveloper 9i release 3, the newest 
|version of Oracle JDeveloper, I used the classpath 
|settings several times without any complains.
|- I tried also IBM Visual Age for Java 3.5.3 with jdk 
|1.2.2  Log4J 1.2.7 the latest also the same problem 
|?!?!?!? == it is not the problem of IDE.
|
|- Thankx for the hint about getFile()   :)
|
|Ashraf Fouad Ayoub
|Senior Developer
|Raya Software
|
|1 Abdel Hameed Lotfy St.,
|Nasr City, Cairo 11371, Egypt
|Phone: *   (202) 670-3301/2/3/4/6/8 Ext. 295
|Fax:   *   (202) 670-3296
|Email: * [EMAIL PROTECTED]
|Web: * http://www.rayasoftware.com/
|
|
|-Original Message-
|From: Steve Ebersole [mailto:[EMAIL PROTECTED]]
|Sent: Wednesday, January 29, 2003 2:30 PM
|To: Log4J Users List
|Subject: Re: NOONE TO ANSWER ? sorry for the previous mail
|
|
|If #1 and #2 did not work, then the directory you think is 
|in the classpath
|is in fact not in the classpath.  When log4j initializes 
|itself, it looks
|for a config file named lo4j.properties in the classpath.
|
|I would recheck what your IDE considers in the classpath 
|versus not in the
|class path.  Its not like this is a problem with log4j; 
|this works for many
|people in many places in many scenarios on many platforms, etc
|
|
|
|
|P.S., if you want the URL without the file:// URL protocol 
|identifier, try
|the URL.getFile() method (no need to do substringing on 
|your own...).
|String semiFullPath =
|_my.getClass().getClassLoader().getResource( 
|xx_log4j.properties).getFile(
|);
|
|
|
|
|- Original Message -
|From: Ashraf Fouad [EMAIL PROTECTED]
|To: Log4J Users List [EMAIL PROTECTED]
|Sent: Wednesday, January 29, 2003 4:58 AM
|Subject: RE: NOONE TO ANSWER ? sorry for the previous mail
|
|
|yes, xx_log4j.properties is the properties file defined in 
|my IDE classpath.
|
|I tried yr ways, and here is my results:
|
|1- Trial of renaming the the file to log4j.properties 
|(Didn't work):
|log4j:ERROR Could not read configuration file [log4j.properties].
|java.io.FileNotFoundException: log4j.properties (The 
|system cannot find the
|file specified. )
|void java.io.FileInputStream.open(java.lang.String)
|native code
|void java.io.FileInputStream.init(java.lang.String)
|FileInputStream.java:64
|void 
|org.apache.log4j.PropertyConfigurator.doConfigure(java.lang.String,
|org.apache.log4j.spi.LoggerRepository)
|PropertyConfigurator.java:297
|void 
|org.apache.log4j.PropertyConfigurator.configure(java.lang.String)
|PropertyConfigurator.java:315 0
|[main] INFO  com.rsw.test.MyAppProperty  - Entering 
|application. 140
|[main] DEBUG com.rsw.test.Bar  - Did it again! 140
|[main] WARN  com.rsw.test.MyAppProperty  - Hello world all 
|ante7 fentakes
|140
|[main] WARN  com.rsw.test.MyAppProperty  - Hello world all 
|ante7 fentakes
|150
|[main] WARN  com.rsw.test.MyAppProperty  - Hello world all 
|ante7 fentakes
|150
|[main] INFO  com.rsw.test.MyAppProperty  - Exiting application.
|void com.rsw.test.MyAppProperty.main(java.lang.String[])
|MyAppProperty.java:19
|log4j:ERROR Ignoring configuration file [log4j.properties].
|Process exited with exit code 0.
|
|2- I tried to set the -D options but also didn't work
|
|3- It worked :))), I used the following:
|String l_szfull =
|_my.getClass().getClassLoader().getResource( 
|xx_log4j.properties).toExtern
|alForm();
|// Delete the first 6 characters from the path to delete file:/
|// Still u will have
|drive_name:/whatever/path/u/specify/xx_log4j.properties
|PropertyConfigurator.configure( fullPath.substring( 6 ) );
|
|Thankx a lot Steven, but I feel that there is something 
|wrong I use, as all
|is using log4j  didn't face such problem I don't know why?
|anyway it worked, I insisted on writing the code so that 
|others can benifit
|from it
|
|
|---
|--
|To unsubscribe, 

RE: NOONE TO ANSWER ?

2003-01-28 Thread Ebersole, Steven
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 xx_log4j.properties to log4j.properties
2) If your IDE supports setting of environmental properties (-D options),
try setting log4j.configuration=xx_log4j.properties
3) Explicitly locate the file yourself and feed it to log4j.  Locating a
file relative from the classpath is acheived using the
ClassLoader.getResource() or ClassLoader.getSystemResouce() methods (they
return URL objects).  Try: String fullPath =
this.getClass().getClassLoader().getResource( xx_log4j.properties
).toExternalForm();

HTH



|-Original Message-
|From: Ashraf Fouad [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, January 28, 2003 8:44 AM
|To: Log4J Users List
|Subject: NOONE TO ANSWER ?
|
|
|
|
|Ashraf Fouad Ayoub
|Senior Developer
|Raya Software
|
|1 Abdel Hameed Lotfy St.,
|Nasr City, Cairo 11371, Egypt
|Phone: *   (202) 670-3301/2/3/4/6/8 Ext. 295
|Fax:   *   (202) 670-3296
|Email: * [EMAIL PROTECTED]
|Web: * http://www.rayasoftware.com/
|
|
|-Original Message-
|From: Ashraf Fouad 
|Sent: Monday, January 27, 2003 11:19 AM
|To: [EMAIL PROTECTED]
|Subject: Can't read property file in log4j
|
|
|
|Hello all,
|I'm still a beginner using Log4J, I'm trying using 
|property file for setting the confirguration for log4j in 
|a test java file with main method, I set the classpath - 
|in Oracle JDeveloper 9i_3 - for a location that reside 
|with xx_log4j.properties, but the file was never read, 
|except I write the full path of it, I opened the source of 
|the PropertyConfigurator  I found that it reads the file 
|using Properties class, which I think does not search the 
|classpath for file. 
|so any suggestion ?!?!?!?!?! 
|I thought for an idea to use something to search the 
|classpath for the file, then get the absolute path and 
|pass it in the PropertyConfigurator, I tried 
|to use ResourceBundle class but there is no method to 
|return the absolute path.  
|so any suggestion to determine a file in the classpath 
|?!?!?!?!?!?!?!?
|
|Ashraf Fouad Ayoub
|Senior Developer
|Raya Software
|
|1 Abdel Hameed Lotfy St.,
|Nasr City, Cairo 11371, Egypt
|Phone: *   (202) 670-3301/2/3/4/6/8 Ext. 295
|Fax:   *   (202) 670-3296
|Email: * [EMAIL PROTECTED]
|Web: * http://www.rayasoftware.com/
|
|
|--
|To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Log4j Clashing over applications

2003-01-24 Thread Ebersole, Steven
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 are defined on the server start-up classpath
(i.e., a custom security realm, etc) which use log4j, that will also cause
you problems.

The issue is really with java's classloading paradigm where child
classloaders first delegate classloading to its parent.  So J2EE terms, if
the EJB context specifc classloader delegates to its parent (the system
classloader in wl6.1) and its parent finds it, then its parent loads it and
that class is now accessible at the visibility level of the parent...


I am pretty sure that weblogic 6.1 does not use log4j for its logging.  I
use WL6.1sp3 and it uses some garbage home-brew domain logging system, not
log4j.

HTH




|-Original Message-
|From: Munish Singla [mailto:[EMAIL PROTECTED]]
|Sent: Friday, January 24, 2003 1:18 PM
|To: 'Log4J Users List'
|Subject: Log4j Clashing over applications
|
|
|Hi Guys,
|
|   I have one weblogic 6.1 server to deploy my application 
|for both dev
|and qa environments. Both these are deployed hot as ear 
|files. They have
|pretty much the same application except for a 
|configuration file and log4
|configuration which is separate for both of them.
|
|   The problem is that if I deploy one of them, everything 
|is fine and
|the logs are going in the right places and the right log4j 
|configuration is
|read, however if i deploy both of them, the problem is the 
|logs for both dev
|and qa start using the same configuration as of the latest 
|one that I
|deployed. I thought the Logger classes that are loaded by 
|the applications
|are separate for both dev and qa as by EJB spec, its supposed to be
|different Class Loaders. One problem looks to be from the 
|weblogic itself
|using log4j for its logging so the Logger is already 
|loaded and is not
|separate for both the applications.
|
|   Has anybody faced this problem before. Any workaround??
|
|Munish
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: additivity in PropertyConfigurator

2003-01-22 Thread Ebersole, Steven
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 Message-
|From: Evans Mark-PT1167 [mailto:[EMAIL PROTECTED]]
|Sent: Wednesday, January 22, 2003 1:12 PM
|To: 'Log4J Users List'
|Subject: additivity in PropertyConfigurator
|
|
|I need help setting the additivity in my log4j properties 
|file.  (It doesn't seem to be working for me.)  
|
|I want to log a specific class (logger) to one file, (and 
|in my example below log a second class (logger) to another 
|file), while logging the rest of my classes to a third 
|file (root logger).
|
|I'm using a PropertyConfigurator.  However, when I set 
|additivity on my category, per documentation, I still 
|get all messages going to the root logger's file.
|
|I'm following the example at 
|http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/P
|ropertyConfigurator.html
|
|which shows:
|log4j.additivity.SECURITY=false 
|
|Additional additivity information is found at 
|http://jakarta.apache.org/log4j/docs/manual.html#additivity
|
|where it states:
|
|   Appender Additivity 
|   The output of a log statement of logger C will 
|go to all the appenders in C and its ancestors. This is 
|the meaning of the term appender additivity. 
|   However, if an ancestor of logger C, say P, has 
|the additivity flag set to false, then C's output will be 
|directed to all the appenders in C and it's ancestors upto 
|and including P but not the appenders in any of the 
|ancestors of P. 
|   Loggers have their additivity flag set to true 
|by default. 
|which  imply that the ancestor P, when his additivity is 
|set to false, STILL logs messages, but doesn't pass them 
|to the parent.  So, I guess if you set additivity on your 
|logger C, C messages will be logged, but not passed up 
|to parents.  (I think that's what I'm doing...)
|
|Here's the details, thanks for any help.  --Mark
|
|
|
|
|I'm logging logger3 to log4j.3.log.
|I'm logging logger4 to log4j.4.log.
|I'm logging the root category to log4j.log (here are the 
|messages I believe don't belong.)
|
|Code:
|...
|static Category logger3 = 
|Category.getInstance(com.printrak.me3);
|static Category logger4 = 
|Category.getInstance(com.printrak.me4);
|...
|   PropertyConfigurator.configure(log4j.properties);
|
|
|   logger3.debug(This is debug to logger3/me3.);
|   logger4.debug(This is debug to logger4/me4.);
|...
|
|
|log4j.3.log:
|2003-01-22 11:00:14,896 DEBUG [main] - This is debug to 
|logger3/me3.
|
|log4j.4.log:
|2003-01-22 11:00:14,906 DEBUG [main] - This is debug to 
|logger4/me4.
|
|log4j.log: (why are these here with additivity set to false?)
|2003-01-22 11:00:14,896 DEBUG [main] - This is debug to 
|logger3/me3.
|2003-01-22 11:00:14,906 DEBUG [main] - This is debug to 
|logger4/me4.
|
|
|Configuration file:
|
|log4j.rootCategory=WARN, R
|  
|log4j.category.com.printrak.me3=DEBUG, R3
|log4j.category.com.printrak.me4=DEBUG, R4
|
|log4j.category.com.printrak=DEBUG
|
|# Pattern to output the caller's file name and line number.
|
|log4j.appender.R=org.apache.log4j.FileAppender
|log4j.appender.R.File=log4j.log
|og4j.appender.R.layout=org.apache.log4j.PatternLayout
|log4j.appender.R.layout.ConversionPattern=%d %5p [%t] - %m%n
|
|log4j.appender.R3=org.apache.log4j.FileAppender
|log4j.appender.R3.File=log4j.3.log
|log4j.appender.R3.layout=org.apache.log4j.PatternLayout
|log4j.appender.R3.layout.ConversionPattern=%d %5p [%t] - %m%n
|log4j.additivity.R3=false
|
|log4j.appender.R4=org.apache.log4j.FileAppender
|log4j.appender.R4.File=log4j.4.log
|#log4j.appender.R4.DatePattern='.'-MM-dd
|log4j.appender.R4.layout=org.apache.log4j.PatternLayout
|log4j.appender.R4.layout.ConversionPattern=%d %5p [%t] - %m%n
|log4j.additivity.R4=false
|
|log4j.category.org.jboss=WARN
|log4j.category.com.printrak=DEBUG
|
|
|--
|To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Help !

2003-01-16 Thread Ebersole, Steven
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 already exists (it was
created above), so that logger is returned (including the two appenders
previously attached)
2) Two appenders are added to the logger (a console appender and a file
appender).

Etc...


Assuming that there is a vaild reason you need to wrap all these log4j calls
inside your own hand-rolled class, then try something like the following
code change in the constructor:


public Trace( String class_name )
{
if (!LogManager.exists( class_name ))
{
logger = LogManager.getLogger(class_name);
Layout layout = new PatternLayout(%d{MMdd-HH:mm:ss} %m%n);
logger.addAppender(new ConsoleAppender(layout,
ConsoleAppender.SYSTEM_OUT));
  logger.setLevel(Level.DEBUG);
try 
{
logger.addAppender(new FileAppender(layout,
(String)Ecx_constants.getInstance().get(log4j_fileTrace), true));
  }
catch (IOException e)
{}
}
}

But the better solution is to perform initialization of the log4j library
through config files.





|-Original Message-
|From: Sébastien Hiblot [mailto:[EMAIL PROTECTED]]
|Sent: Thursday, January 16, 2003 7:22 AM
|To: [EMAIL PROTECTED]
|Subject: Help !
|
|
|Hi,
|
|We're working on a java web site and we'd like to use 
|log4j in order
|to log the error.
|
|We have made a class to implement the init of log4j. Here 
|the source of this
|class :
|
|private Logger logger ;
|
|public Trace(String class_name) {
|   logger = LogManager.getLogger(class_name);
|  Layout layout = new 
|PatternLayout(%d{MMdd-HH:mm:ss} %m%n);
|  logger.addAppender(new ConsoleAppender(layout,
|ConsoleAppender.SYSTEM_OUT));
|  logger.setLevel(Level.DEBUG);
|  try {
|   logger.addAppender(new FileAppender(layout, (String)
|Ecx_constants.getInstance().get(log4j_fileTrace), true));
|  } catch (IOException e) {
|}
|
|To log something :
|Trace t = new Trace(this.getClass().toString()) ;
|t.debug(My message);
|
|The first time, we call the page, the log contain the good thing :
|20030116-12:00:00 My message
|
|But the second time we call the page, 30 sec after, we 
|have in the log:
|20030116-12:00:00 My message
|20030116-12:00:30 My message
|20030116-12:00:30 My message
|
|== the log appears 2 times !
|the third time, the log appears 3 time, etc..
|
|Can you help us please ?
|
|Thx
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Help !

2003-01-16 Thread Ebersole, Steven
I also use Weblogic and war/ear file deployment.  However, I just wrote a
simple little set of JSPs to allow dynamic overrides of the level for
defined appenders.  This is particular useful for things like user-specific
loggers...

However, I let log4j initialize itself initially from its config files.

Just some thoughts...



|-Original Message-
|From: Sébastien Hiblot [mailto:[EMAIL PROTECTED]]
|Sent: Thursday, January 16, 2003 9:20 AM
|To: Log4J Users List
|Subject: RE: Help !
|
|
|Thx a lot !!!
|the problem was that we always add the appenders. So, the 
|first time it's ok
|but after, we always add the two appenders.
|
|Now we use the exists method in order to know if the logger exists.
|if not, we create the logger and then add the appenders.
|if exists, we do nothing !
|
|You ask why we make the config in the java code.
|For our java web site, we use Weblogic and ear file.
|We have to specify and modify easily some parameter 
|without deploying the
|ear file like the level,
|the file where we write, the repository where is the xml 
|containing the
|message.
|
|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]]
| Envoyé : jeudi 16 janvier 2003 14:54
| À : 'Log4J Users List'
| Objet : RE: Help !
|
|
| 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 already
| exists (it was
| created above), so that logger is returned (including 
|the two appenders
| previously attached)
| 2) Two appenders are added to the logger (a console 
|appender and a file
| appender).
|
| Etc...
|
|
| Assuming that there is a vaild reason you need to wrap all these
| log4j calls
| inside your own hand-rolled class, then try something 
|like the following
| code change in the constructor:
|
|
| public Trace( String class_name )
| {
|  if (!LogManager.exists( class_name ))
|  {
|  logger = LogManager.getLogger(class_name);
|  Layout layout = new
| PatternLayout(%d{MMdd-HH:mm:ss} %m%n);
|  logger.addAppender(new ConsoleAppender(layout,
| ConsoleAppender.SYSTEM_OUT));
|logger.setLevel(Level.DEBUG);
|  try
|  {
|  logger.addAppender(new FileAppender(layout,
| 
|(String)Ecx_constants.getInstance().get(log4j_fileTrace), true));
|}
|  catch (IOException e)
|  {}
|  }
| }
|
| But the better solution is to perform initialization of 
|the log4j library
| through config files.
|
|
|
|
|
| |-Original Message-
| |From: Sébastien Hiblot 
|[mailto:[EMAIL PROTECTED]]
| |Sent: Thursday, January 16, 2003 7:22 AM
| |To: [EMAIL PROTECTED]
| |Subject: Help !
| |
| |
| |Hi,
| |
| |We're working on a java web site and we'd like to use
| |log4j in order
| |to log the error.
| |
| |We have made a class to implement the init of log4j. Here
| |the source of this
| |class :
| |
| |private Logger logger ;
| |
| |public Trace(String class_name) {
| |logger = LogManager.getLogger(class_name);
| |  Layout layout = new
| |PatternLayout(%d{MMdd-HH:mm:ss} %m%n);
| |  logger.addAppender(new ConsoleAppender(layout,
| |ConsoleAppender.SYSTEM_OUT));
| |  logger.setLevel(Level.DEBUG);
| |  try {
| |logger.addAppender(new 
|FileAppender(layout, (String)
| |Ecx_constants.getInstance().get(log4j_fileTrace), true));
| |  } catch (IOException e) {
| |}
| |
| |To log something :
| |Trace t = new Trace(this.getClass().toString()) ;
| |t.debug(My message);
| |
| |The first time, we call the page, the log contain 
|the good thing :
| |20030116-12:00:00 My message
| |
| |But the second time we call the page, 30 sec after, we
| |have in the log:
| |20030116-12:00:00 My message
| |20030116-12:00:30 My message
| |20030116-12:00:30 My message
| |
| |== the log appears 2 times !
| |the third time

RE: Quick question on the scope of Log4j's configuration settings

2003-01-10 Thread Ebersole, Steven
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 for
each defined web app;ication.



|-Original Message-
|From: Lutz Michael [mailto:[EMAIL PROTECTED]]
|Sent: Friday, January 10, 2003 8:54 AM
|To: 'Log4J Users List'
|Subject: Quick question on the scope of Log4j's 
|configuration settings
|
|
|
|
|Thanks in advance for any feedback.
|
|My organization has a non-negotiable requirement to 
|support many customers
|on a given machine.  The J2EE servlet standard has rules 
|specifying how each
|web application in a servlet container owns its own class 
|loader.  Thus, in
|the same JVM process space, we are able to support 
|multiple customers
|running multiple versions of our code.
|
|The question deals with Log4j's ability to be configured 
|differently for
|such customers, given the fact that they may be running in 
|the same JVM
|process space, but under different web applications.
|
|So the question is - when Log4j is configured, what is the 
|scope of the
|configuration settings?  I've looked through the 
|documentation (which is
|excellent) and couldn't find this answer (maybe the answer 
|is implied and I
|just didn't get it).  Is the scope the entire JVM process 
|space, thus
|disallowing our scenario?  ... or following Ceki's servlet-based
|configuration pattern 
|(http://jakarta.apache.org/log4j/docs/manual.html), in
|a servlet world (and if we include the Log4j jar's in each 
|Web application),
|can we isolate the effect of configuring Log4j to distinct 
|Web applications
|even though they run in the same JVM space?
|
|I'm thinking the question really comes down to - (a) how does Log4j
|internally maintain config settings (statics?), and (b) 
|what is the effect
|from a scope perspective of this approach - e.g. can we 
|isolate down to the
|web application level inside a single JVM space and 
|servlet container.
|
|This question is very important to my organization, thanks 
|for your time.
|
|Mike
|
|---
|
|This message and any included attachments are from Siemens 
|Medical Solutions 
|Health Services Corporation and are intended only for the 
|addressee(s).  
|The information contained herein may include trade secrets 
|or privileged or 
|otherwise confidential information.  Unauthorized review, 
|forwarding, printing, 
|copying, distributing, or using such information is 
|strictly prohibited and may 
|be unlawful.  If you received this message in error, or 
|have reason to believe 
|you are not authorized to receive it, please promptly 
|delete this message and 
|notify the sender by e-mail with a copy to 
|[EMAIL PROTECTED]  Thank you
|
|--
|To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Log4j problem

2002-12-24 Thread Ebersole, Steven
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
log4j.additivity.com.sel.CxLoggingAdapter=false
log4j.logger.com.sel.CxLoggingAdapter=DEBUG,R



|-Original Message-
|From: Ranjit Gopalan [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, December 24, 2002 11:06 AM
|To: [EMAIL PROTECTED]
|Subject: Log4j problem
|
|
|Hi All,
|
| 
|
|I am using the following log4j.properties file. the 
|problem is it appends to
|A2 when i get the logger of CxLoggingAdapter while i am 
|exception it to log
|to R. can any body tell me why this is happening.
|
|Thanks in advance
|
|Ranjit
|
| 
|
|log4j.rootLogger=DEBUG,A2
|
|log4j.appender.A2=org.apache.log4j.RollingFileAppender
|
|log4j.appender.A2.File=SQLLog.log
|
|log4j.appender.A2.Append=true
|
|log4j.appender.A2.MaxFileSize=100KB
|
|log4j.appender.A2.MaxBackupIndex=1
|
|log4j.appender.A2.layout=org.apache.log4j.PatternLayout
|
|log4j.appender.A2.layout.ConversionPattern=%d{DATE} - %m%n
|
|log4j.appender.R=org.apache.log4j.RollingFileAppender
|
|log4j.appender.R.File=adm.log
|
|log4j.appender.R.MaxFileSize=100KB
|
|log4j.appender.R.MaxBackupIndex=1
|
|log4j.appender.R.layout=org.apache.log4j.PatternLayout
|
|log4j.appender.R.layout.ConversionPattern=%-4r %-5p [%t] 
|%37c %3x - %m%n
|
|log4j.additivity.com.sel.CxLoggingAdapter=false
|
|log4j.logging.com.sel.CxLoggingAdapter=DEBUG,R
|
|log4j.logging.SQLLog=INFO,R
|
|log4j.logging.red=INFO,R
|
| 
|
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Multiple log4j JMS appenders with Weblogic 7

2002-12-18 Thread Ebersole, Steven
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 as the topic?  If not, at least localhost is not
correct.  And the port may not be correct either.

If you are not explicitly passing these arguments, you need to for that
second appender so that it knows the URL from which to obtain the
InitialContext from which it can lookup the specified topic elements. You
can do that like this (for .properties file):
log4j.appender.JMS.ProviderUrl=t3://my.log.srv.domain.com:7001
replacing the appropriate values.




|-Original Message-
|From: Clive Beavis [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, December 17, 2002 4:00 PM
|To: 'Log4J Users List'
|Subject: Multiple log4j JMS appenders with Weblogic 7
|
|
|I cannot get two log4j JMS appenders to append to a single 
|Weblogic JMS
|Topic if one of the log4j appenders is running on the 
|weblogic server that
|is also supporting the JMS topic.
|
|The second server (not the one supporting the JMS Topic) 
|will always fail
|with connection not found .
|
|Simple modification of the Weblogic Topic example shows 
|that other processes
|can make the connection successfully.
|
|Also running the JMS Topic server as a separate instance 
|from either of my
|two log4j servers works fine.
|
|Anyone any idea if this is a log4j topic initialization 
|issue or a Weblogic
|configuration/subtlety issue please?
|
|I have tried Initializing log4j in the servlets and as a 
|main start program,
|same result
|
|Thanks
|
|Clive
|
|
|
|Error message details
|log4j: Class name: [org.apache.log4j.net.JMSAppender]
|log4j: Setting property [initialContextFactoryName] to
|[weblogic.jndi.WLInitialContextFactory].
|log4j: Setting property [providerURL] to [t3://localhost:8080].
|log4j: Setting property [topicConnectionFactoryBindingName] to
|[cipient.jms.IDPFactory].
|log4j: Setting property [topicBindingName] to 
|[cipient.jms.IDPTopic].
|log4j: Setting property [locationInfo] to [true].
|log4j: Getting initial context.
|log4j: Looking up [cipient.jms.IDPFactory]
|log4j: About to create TopicConnection.
|log4j: Creating TopicSession, non-transactional, in 
|AUTO_ACKNOWLEDGE mode.
|log4j:ERROR Error while activating options for appender 
|named [JMS].
|weblogic.jms.common.JMSException: Connection not found
|at
|weblogic.jms.dispatcher.InvocableManager.invocableFind(Invo
|cableManager.java
|:134)
|at
|weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(R
|equest.java:539)
|at
|weblogic.jms.dispatcher.DispatcherImpl.dispatchSync(Dispatc
|herImpl.java:275)
|at 
|weblogic.jms.client.JMSConnection.createSession(JMSConnecti
|on.java:368)
|at
|weblogic.jms.client.JMSConnection.createTopicSession(JMSCon
|nection.java:339)
|at org.apache.log4j.net.JMSAppender.activateOptions(Unknown Source)
|at 
|org.apache.log4j.config.PropertySetter.activate(PropertySet
|ter.java:247)
|at
|org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfi
|gurator.java:210)
|at
|org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOM
|Configurator.java
|:140)
|at
|org.apache.log4j.xml.DOMConfigurator.findAppenderByReferenc
|e(DOMConfigurator
|.java:153)
|at
|org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerE
|lement(DOMConfigu
|rator.java:415)
|at 
|org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigura
|tor.java:384)
|at 
|org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.
|java:790)
|at
|org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigu
|rator.java:673)
|at
|org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigu
|rator.java:616)
|  at
|org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigu
|rator.java:584)
|at 
|org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigura
|tor.java:694)
|at cipient.util.Debug.clinit(Debug.java:43)
|at java.lang.Class.forName0(Native Method)
|at java.lang.Class.forName(Class.java:115)
|at
|weblogic.t3.srvr.StartupClassRunner.invokeClass(StartupClas
|sRunner.java:120)
|at 
|weblogic.t3.srvr.StartupClassRunner.access$0(StartupClassRu
|nner.java:113)
|at 
|weblogic.t3.srvr.StartupClassRunner$1.run(StartupClassRunne
|r.java:86)
|at
|weblogic.security.service.SecurityServiceManager.runAs(Secu
|rityServiceManage
|r.java:744)
|at 

RE: JMS outside of J2EE?

2002-12-18 Thread Ebersole, Steven
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 need a J2EE container to perform JMS messaging.




|-Original Message-
|From: Basilio James [mailto:[EMAIL PROTECTED]]
|Sent: Wednesday, December 18, 2002 7:51 AM
|To: '[EMAIL PROTECTED]'
|Subject: JMS outside of J2EE?
|
|
|
|I have a questions that's fueling some debate about 
|whether we can use the
|JMS appender or not.
|
|The simple questions is:  Is JMS available without 
|running a full blown
|J2EE container?  Can the JMS api be used without a container?
|
|Our application will be deployed to apache/tomcat for now. 
| The JMS log4j
|appender gives us the most reliability for messages but 
|since we do not have
|a J2EE container it seems this is not an option.  Right?  
|Is that incorrect?
|
|
|TIA,
|
|Jim
|
|
|---
|
|This message and any included attachments are from Siemens 
|Medical Solutions 
|Health Services Corporation and are intended only for the 
|addressee(s).  
|The information contained herein may include trade secrets 
|or privileged or 
|otherwise confidential information.  Unauthorized review, 
|forwarding, printing, 
|copying, distributing, or using such information is 
|strictly prohibited and may 
|be unlawful.  If you received this message in error, or 
|have reason to believe 
|you are not authorized to receive it, please promptly 
|delete this message and 
|notify the sender by e-mail with a copy to 
|[EMAIL PROTECTED]  Thank you
|
|--
|To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: log4j in EJB

2002-12-03 Thread Ebersole, Steven
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 you got (SecurityException)?




|-Original Message-
|From: Yi Chen [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, December 03, 2002 10:30 AM
|To: Log4J Users List
|Subject: RE: log4j in EJB
|
|
|Alberto,
|
|We probably will do JMS based appender for cluster 
|environment. What I am
|working on is a single machine case, but I haven't figured 
|out where to make
|changes in the configuration so the file based appender 
|will work. Do you
|mind sharing the trick?
|
|Thanks,
|
|Yi
|
|-Original Message-
|From: Ferrari Alberto [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, December 03, 2002 11:27 AM
|To: Log4J Users List
|Subject: R: log4j in EJB
|
|
|yes,
|
|it works well in not cluster environment. Problems begin 
|if more Virtual
|Machine try to write the same file
|
|Alberto
|
|-Messaggio originale-
|Da: Yi Chen [mailto:[EMAIL PROTECTED]]
|Inviato: martedì 3 dicembre 2002 17.16
|A: Log4J Users List
|Oggetto: log4j in EJB
|
|
|Using file based appender inside EJB is restricted, but 
|has anyone tried
|configuring weblogic to open the back door so that logger 
|inside EJB can
|write to a log file?
|
|Thanks.
|
|Yi
|
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|
|
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: weblogic6.1 log4j

2002-12-02 Thread Ebersole, Steven
I am also using WL under Solaris, so I'm pretty sure that that is not the
problem.

Are those first two lines valid inside the properties file?  Especially,
log4j.debug since it will look for that even prior to attempting to locate
the config file.  When you start weblogic, you should see some messages
dumped to the console prefixed with LOG4J:  Do you see these?  What do they
say?

Also try removing the first 2 lines from the prop file; you can set them
using java system properties as follows:
   java ... -D log4j.debug=true -D VASP_LOG_HOME=/vobs/vasp/log ...
weblogic.Server
in your startWebLogic.sh script.




|-Original Message-
|From: Yi Chen [mailto:[EMAIL PROTECTED]]
|Sent: Monday, December 02, 2002 8:48 AM
|To: Log4J Users List
|Subject: RE: weblogic6.1  log4j
|
|
|
|Steven,
|
|here is what my log4j is like:
|
|===
|=
|=
|log4j.debug=true
|# /vobs is a directory under the root of a unix file system
|VASP_LOG_HOME=/vobs/vasp/log
|log4j.rootLogger=DEBUG, DebugRootAppender, InfoRootAppender,
|ErrorRootAppender
|log4j.logger.net.veriaon.vasp=DEBUG, DebugRootAppender, 
|InfoRootAppender,
|ErrorRootAppender
|
|# Set attributes for appender:  DebugRootAppender
|log4j.appender.DebugRootAppender=org.apache.log4j.RollingFi
|leAppender
|log4j.appender.DebugRootAppender.layout=org.apache.log4j.Pa
|tternLayout
|log4j.appender.DebugRootAppender.File=${VASP_LOG_HOME}/debug.log
|log4j.appender.DebugRootAppender.MaxBackupIndex=19
|log4j.appender.DebugRootAppender.MaxFileSize=40MB
|log4j.appender.DebugRootAppender.Threshold=DEBUG
|
|# Set attributes for appender:  InfoRootAppender
|log4j.appender.InfoRootAppender=org.apache.log4j.RollingFil
|eAppender
|log4j.appender.InfoRootAppender.layout=org.apache.log4j.Pat
|ternLayout
|log4j.appender.InfoRootAppender.File=${VASP_LOG_HOME}/info.log
|log4j.appender.InfoRootAppender.MaxBackupIndex=9
|log4j.appender.InfoRootAppender.MaxFileSize=20MB
|log4j.appender.InfoRootAppender.Threshold=INFO
|
|# Set attributes for appender:  ErrorRootAppender
|log4j.appender.ErrorRootAppender=org.apache.log4j.RollingFi
|leAppender
|log4j.appender.ErrorRootAppender.layout=org.apache.log4j.Pa
|tternLayout
|log4j.appender.ErrorRootAppender.File=${VASP_LOG_HOME}/error.log
|log4j.appender.ErrorRootAppender.MaxBackupIndex=9
|log4j.appender.ErrorRootAppender.MaxFileSize=4MB
|log4j.appender.ErrorRootAppender.Threshold=ERROR
|
|===
|=
|==
|
|I put log4j-1.2.7.jar and log4j.properties in the same directory
|(bea/wlserver6.1/lib/vasp) and this directory itself is 
|also added as
|classpath. It didn't have problem finding this property 
|file. I 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 PROTECTED]]
|Sent: Saturday, November 30, 2002 1:46 PM
|To: 'Log4J Users List'
|Subject: RE: weblogic6.1  log4j
|
|
|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 which use log4j for logging)?  What does your 
|log4j.properties file
|look like?
|
|
|
||-Original Message-
||From: Yi Chen [mailto:[EMAIL PROTECTED]]
||Sent: Friday, November 29, 2002 10:22 AM
||To: [EMAIL PROTECTED]
||Subject: weblogic6.1  log4j
||
||
||Do we have anyone is this list using log4j for weblogic6.1
||based web
||application? I found something strange: the logger
||(created in a jsp page)
||can write to the weblogic console even I didn't config the
||console appender
||in log4j.propertiesl and I don't see any output to the
||assigned log file. By
||the way, I put log4j.properties in weblogic classpath. Any
||information will
||be appreciated.
||
||Thanks,
||
||Yi
||
||
||
||--
||To unsubscribe, e-mail:
||mailto:[EMAIL PROTECTED]
||For additional commands, e-mail:
||mailto:[EMAIL PROTECTED]
||
|
|--
|To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL

RE: weblogic6.1 log4j

2002-11-30 Thread Ebersole, Steven
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 which use log4j for logging)?  What does your log4j.properties file
look like?



|-Original Message-
|From: Yi Chen [mailto:[EMAIL PROTECTED]]
|Sent: Friday, November 29, 2002 10:22 AM
|To: [EMAIL PROTECTED]
|Subject: weblogic6.1  log4j
|
|
|Do we have anyone is this list using log4j for weblogic6.1 
|based web
|application? I found something strange: the logger 
|(created in a jsp page)
|can write to the weblogic console even I didn't config the 
|console appender
|in log4j.propertiesl and I don't see any output to the 
|assigned log file. By
|the way, I put log4j.properties in weblogic classpath. Any 
|information will
|be appreciated.
|
|Thanks,
|
|Yi
|
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: NDC , Servlets and thread safety

2002-11-06 Thread Ebersole, Steven
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 in your code.

HTH



|-Original Message-
|From: Ceki Gülcü [mailto:ceki;qos.ch]
|Sent: Wednesday, November 06, 2002 10:36 AM
|To: Log4J Users List
|Subject: Re: NDC , Servlets and thread safety
|
|
|At 16:23 06.11.2002 +, you wrote:
|
|Hi,
|
|This may have been asked before but I cant find it in the 
|archives. I am
|trying to use the log4j NDC class to log and distinguish 
|between multiple
|client requests coming into a single servlet instance (we 
|are using the
|frontcontroller pattern). We issue a NDC.push() at the 
|start of the doPost
|method passing in the session ID and a NDC.pop() at the 
|end of the doPost()
|method.#
|
|As the servlet operates in the same thread and doPost() 
|is not synchronized
|isn't it quite possible that two users could get into the 
|same method and
|effectively push() two lots of information into the NDC 
|so that the output
|from log4j contains session ids from BOTH of the clients.
|
|That is not possible. The NDC is managed on a per thread 
|basis. Different 
|threads have different NDCs.
|
|Apologies if I'm being stupid but if this is a problem has anyone
|encountered this before and have an elegant solution?
|
|There can't be a solution to a non-existent problem.
|
|By the way we don't really want to make the servlet implement the
|SingleThreadModel or synchronize the doGet, doPost 
|methods as we believe
|this would kill the application.
|
|You do not need to use SingleThreadModel or synchronize 
|the doGet, doPost 
|methods.
|
|However, you should make sure to call NDC.remove from time 
|to time. Also 
|check out the MDC class.
|
|BTW, please do not cross post to log4j-user *and* 
|log4j-dev. The next time 
|I won't be answering.
|
|Thanks in advance of any comments
|
|Graham Mead
|
|--
|Ceki
|
|TCP implementations will follow a general principle of 
|robustness: be
|conservative in what you do, be liberal in what you accept from
|others. -- Jon Postel, RFC 793
|
|
|
|--
|To unsubscribe, e-mail:   
mailto:log4j-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:log4j-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   mailto:log4j-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:log4j-user-help;jakarta.apache.org




RE: JMSAppender in Container Managed Transactions

2002-09-06 Thread Ebersole, Steven

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 the topic?  MessageDrivenBean
MessageListener implementation?  What is the set up of this consumption
piece?



|-Original Message-
|From: Benary Klaus [mailto:[EMAIL PROTECTED]]
|Sent: Friday, September 06, 2002 7:21 AM
|To: '[EMAIL PROTECTED]'
|Subject: JMSAppender in Container Managed Transactions
|
|
|How can I decouple logging via JMSAppender from the 
|contrainer transaction
|in a stateless session EJB?
|I want the JMSAppender to deliver logs even when I call
|SessionContext.setRollbackOnly(). As a default,
|JMS committs a message to the queue or topic only when the 
|contrainer
|transaction committs. As a side 
|effect, a log within a failing contrainer transaction 
|shows up only in those
|appenders that do not use JMS.
|Am I missing something?
|Any help would be appreciated.
|
|Klaus
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: JMSAppender in Container Managed Transactions

2002-09-06 Thread Ebersole, Steven



|-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 using? 
|Which version of 
|the JMS spec?
|
|ps: I doubt AUTO_ACKNOWLEDGE mode has anything to do with 
|transactions in 
|the session.

Did not realize I said it did.  Sorry for any confusion.  I only mentioned
it for completeness because all Producers/consumers need to specify both
options for obtaining jms sessions.  In fact it has absolutely no bearing on
_transactions_ at all from the producer perspective.

However, it can still impact whether message are ultimately delivered to
their destination.  If MessageListeners are attching to your session (MDB or
otherwise) and they fail (with acknowledgement set to auto) then the message
will not be delivered.  That was my point.


|
|At 14:20 06.09.2002 +0200, you wrote:
|How can I decouple logging via JMSAppender from the 
|contrainer transaction
|in a stateless session EJB?
|I want the JMSAppender to deliver logs even when I call
|SessionContext.setRollbackOnly(). As a default,
|JMS committs a message to the queue or topic only when 
|the contrainer
|transaction committs. As a side
|effect, a log within a failing contrainer transaction 
|shows up only in those
|appenders that do not use JMS.
|Am I missing something?
|Any help would be appreciated.
|
|Klaus
|
|--
|Ceki
|
|TCP implementations will follow a general principle of 
|robustness: be
|conservative in what you do, be liberal in what you accept from
|others. -- Jon Postel, RFC 793
|
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: JMSAppender in Container Managed Transactions

2002-09-06 Thread Ebersole, Steven

|-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 
|the real question has to do with whether the JMS drivers 
|are XA-enabled and obtained through a container-defined 
|resource manager. If so, the container is going to try to 
|coordinate any transaction in progress across the JDBC and 
|JMS resources. Usually, that is what you want. In this 

This is just plain false.  There is a reason the JMS spec defines the method
signature to obtain a session object to take a boolean indicating whether
the session should be transactionally aware.  If you specify that the
session should not be transactionaly aware when obtaining from the jms
connection, then the container is not going to try to register it with the
TransactionManager (or if it does you have much larger problems then just
whether your app logging is happening or not).


|case, you want the logging to happen regardless of the 
|transaction outcome. Fundamentally, the JMSAppender needs 
|to obtain its JMS resources from a source other than the 
|container so that the container is not aware of them and 
|doesn't enlist them in the transaction.
|
|Jim
|
|-Original Message-
|From: Benary Klaus [mailto:[EMAIL PROTECTED]]
|Sent: Friday, September 06, 2002 8:16 AM
|To: '[EMAIL PROTECTED]'
|Subject: AW: JMSAppender in Container Managed Transactions
|
|
|Hi Steven, hi Ceki,
|
|There is a listener bean durably subscribed to the topic. 
|The crucial part of the deployment descriptor is:
|
|message-driven
|display-name/display-name
|ejb-nameListenerBean/ejb-name
|ejb-classcom.jcoffee.base.sl.ListenerBean/ejb-class
|transaction-typeContainer/transaction-type
|acknowledge-modeAuto-acknowledge/acknowledge-mode
|message-driven-destination
|destination-typejavax.jms.Topic/destination-type
|subscription-durabilityDurable/subscription-durability
|/message-driven-destination
|resource-ref
|res-ref-namejdbc/DS/res-ref-name
|res-typejavax.sql.DataSource/res-type
|res-authContainer/res-auth
|/resource-ref
|/message-driven
|
|But, I think that the consumer cannot be the reason for 
|this behavior. The
|producer side
|would behave the same way even if there was no consumer 
|subscribed at all.
|Besides: It is BEA 7.00 and WebLogic JMS according to JavaSoft JMS
|specification version 1.0.2.
|
|Klaus
|
|
|
|  -Ursprüngliche Nachricht-
| Von: [EMAIL PROTECTED]@GEHE  
| Gesendet:Freitag, 6. September 2002 14:49
| An:  [EMAIL PROTECTED]
| Betreff: RE: JMSAppender in Container Managed Transactions
| 
| 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 the topic?  
|MessageDrivenBean
| MessageListener implementation?  What is the set up of 
|this consumption
| piece?
| 
| 
| 
|  |-Original Message-
|  |From: Benary Klaus [mailto:[EMAIL PROTECTED]]
|  |Sent: Friday, September 06, 2002 7:21 AM
|  |To: '[EMAIL PROTECTED]'
|  |Subject: JMSAppender in Container Managed Transactions
|  |
|  |
|  |How can I decouple logging via JMSAppender from the
|  |contrainer transaction
|  |in a stateless session EJB?
|  |I want the JMSAppender to deliver logs even when I call
|  |SessionContext.setRollbackOnly(). As a default,
|  |JMS committs a message to the queue or topic only when the
|  |contrainer
|  |transaction committs. As a side
|  |effect, a log within a failing contrainer transaction
|  |shows up only in those
|  |appenders that do not use JMS.
|  |Am I missing something?
|  |Any help would be appreciated.
|  |
|  |Klaus
|  |
|  |
|  |--
|  |To unsubscribe, e-mail:
|  |mailto:[EMAIL PROTECTED]
|  |For additional commands, e-mail:
|  |mailto:[EMAIL PROTECTED]
|  |
| 
| --
| To unsubscribe, e-mail:
| mailto:[EMAIL PROTECTED]
| For additional commands, e-mail:
| mailto:[EMAIL PROTECTED]
| 
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|
|
|font size=1Confidentiality Warning:  This e-mail 
|contains information intended only 

RE: JMSAppender in Container Managed Transactions

2002-09-06 Thread Ebersole, Steven

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 a
little bit cluggy in its JMS setup (though I was hoping this all would have
changed in the new release).

However, I can confirm that this type of setup is working (beautifully) for
me.


Here is the pertinent stuff from my deployment descrioptor:
enterprise-beans
message-driven
...
ejb-nameLoggingQueueConsumer/ejb-name
...
transaction-typeContainer/transaction-type
...
/message-driven
/enterprise-beans

assembly-descriptor
container-transaction
method
ejb-nameLoggingQueueConsumer/ejb-name
method-name*/method-name
/method
trans-attributeNotSupported/trans-attribute
/container-transaction
/assembly-descriptor


***Notice that there is no
acknowledge-modeAuto-acknowledge/acknowledge-mode.  This never seemed
to make any difference in our setup.  I actually had to move the acknowleged
into the bean itself.  And the actual place in which the acknowledement
happened seemed to matter greatly also (ain't weblogic grand?).  Here is
onMessage() method:


public void onMessage( Message message )
{
// This is the method called by the container when a message is
// received on the queue to which this bean is set to listen.
ObjectMessage msg = null;

try
{
// First, make sure the message is of type ObjectMessage
// (i.e., message contains a serialized object.
if (message instanceof ObjectMessage)
{
Object ref = ((ObjectMessage)message).getObject();

// Next, make sure the message's serialized object is of
// type LogRequestMessage
if (ref instanceof LoggingEvent)
{
message.acknowledge();
processMessage( (LoggingEvent)ref );
}
else
{
log.info( Unable to handle ObjectMessage with obect
type  
+ ref.getClass().getName() );
}
}
else
{
log.info( Unable to handle Message of type  + 
message.getClass().getName() );
}
}
catch ( JMSException jmse )
{
log.error( Error retreiving incoming message, jmse );
mdc.setRollbackOnly();
} 
catch ( Throwable e ) 
{
log.error( Error retreiving incoming message, e );
mdc.setRollbackOnly();
}
}


Message.acknowledge() had to be the very first call as soon as I knew that I
was interested in this message (i.e., as soon as I knew it was of type
LoggingEvent).

Again, these may have been corrected in the new release, but the problems
you are facing sound awfully similiar to what I faced.

HTH




|-Original Message-
|From: Benary Klaus [mailto:[EMAIL PROTECTED]]
|Sent: Friday, September 06, 2002 8:16 AM
|To: '[EMAIL PROTECTED]'
|Subject: AW: JMSAppender in Container Managed Transactions
|
|
|Hi Steven, hi Ceki,
|
|There is a listener bean durably subscribed to the topic. 
|The crucial part of the deployment descriptor is:
|
|message-driven
|display-name/display-name
|ejb-nameListenerBean/ejb-name
|ejb-classcom.jcoffee.base.sl.ListenerBean/ejb-class
|transaction-typeContainer/transaction-type
|acknowledge-modeAuto-acknowledge/acknowledge-mode
|message-driven-destination
|destination-typejavax.jms.Topic/destination-type
|subscription-durabilityDurable/subscription-durability
|/message-driven-destination
|resource-ref
|res-ref-namejdbc/DS/res-ref-name
|res-typejavax.sql.DataSource/res-type
|res-authContainer/res-auth
|/resource-ref
|/message-driven
|
|But, I think that the consumer cannot be the reason for 
|this behavior. The
|producer side
|would behave the same way even if there was no consumer 
|subscribed at all.
|Besides: It is BEA 7.00 and WebLogic JMS according to JavaSoft JMS
|specification version 1.0.2.
|
|Klaus
|
|
|
|  -Ursprüngliche Nachricht-
| Von: [EMAIL PROTECTED]@GEHE  
| Gesendet:Freitag, 6. September 2002 14:49
| An:  [EMAIL PROTECTED]
| Betreff: RE: JMSAppender in Container Managed Transactions
| 
| JMSAppender opens its session to the JMS server in 
|AUTO_ACKNOWLEDGE,
| 

RE: JMSAppender in Container Managed Transactions

2002-09-06 Thread Ebersole, Steven

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 only and that log message shows up in
the JMS queue and is processed by the MDB and is placed into the appropriate
log file.

I don't know what elese to tell you.  I did have a lot of problems getting
this set up just right in WebLogic.  In my case it was never a problem with
log4j or the JMSAppender, but more the WebLogic JMS implementation.




|-Original Message-
|From: Benary Klaus [mailto:[EMAIL PROTECTED]]
|Sent: Friday, September 06, 2002 9:24 AM
|To: '[EMAIL PROTECTED]'
|Subject: AW: JMSAppender in Container Managed Transactions
|
|
|I worry about one thing: As long as I do not roll back the 
|contrainer
|transactions my listener MBD works really fine. But when I 
|roll it back the
|onMessage() method of my MDB is not even touched. So, placing the
|acknowledgement whithin the method cannot be the clou. 
|Are you really sure that (in a stateless session bean with
|trans-attribute=Required) you can do things like:
| try { 
| something transactional
| } catch (Exception e) {
|someLogger.info(foo);
|ctx.setRollbackOnly();   
| }
|
|If this works with WLS 6.1 it seems to me that BEA has 
|garbled something on
|their way to 7.00.
|Anyway, I will try to get closer to your configuration 
|(e.g. trying a queue
|instead of a topic).
|
|Thanks for your help
|Klaus
|
|
|
|  -Ursprüngliche Nachricht-
| Von: [EMAIL PROTECTED]@GEHE  
| Gesendet:Freitag, 6. September 2002 15:53
| An:  [EMAIL PROTECTED]
| Betreff: RE: JMSAppender in Container Managed Transactions
| 
| 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 a
| little bit cluggy in its JMS setup (though I was hoping 
|this all would
| have
| changed in the new release).
| 
| However, I can confirm that this type of setup is 
|working (beautifully)
| for
| me.
| 
| 
| Here is the pertinent stuff from my deployment descrioptor:
| enterprise-beans
|  message-driven
|  ...
|  ejb-nameLoggingQueueConsumer/ejb-name
|  ...
|  transaction-typeContainer/transaction-type
|  ...
|  /message-driven
|  /enterprise-beans
| 
|  assembly-descriptor
|  container-transaction
|  method
|  ejb-nameLoggingQueueConsumer/ejb-name
|  method-name*/method-name
|  /method
|  trans-attributeNotSupported/trans-attribute
|  /container-transaction
|  /assembly-descriptor
| 
| 
| ***Notice that there is no
| acknowledge-modeAuto-acknowledge/acknowledge-mode. 
| This never
| seemed
| to make any difference in our setup.  I actually had to move the
| acknowleged
| into the bean itself.  And the actual place in which the 
|acknowledement
| happened seemed to matter greatly also (ain't weblogic 
|grand?).  Here is
| onMessage() method:
| 
| 
|  public void onMessage( Message message )
|  {
|  // This is the method called by the container 
|when a message
| is
|  // received on the queue to which this bean is set to
| listen.
|  ObjectMessage msg = null;
| 
|  try
|  {
|  // First, make sure the message is of type
| ObjectMessage
|  // (i.e., message contains a serialized object.
|  if (message instanceof ObjectMessage)
|  {
|  Object ref = 
|((ObjectMessage)message).getObject();
| 
|  // Next, make sure the message's 
|serialized object
| is of
|  // type LogRequestMessage
|  if (ref instanceof LoggingEvent)
|  {
|  message.acknowledge();
|  processMessage( (LoggingEvent)ref );
|  }
|  else
|  {
| log.info( Unable to handle ObjectMessage with obect
| type 
|  + ref.getClass().getName() );
|  }
|  }
|  else
|  {
|  

RE: Performance between Log4j and custom in-house logger

2002-09-04 Thread Ebersole, Steven

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:


###
# Define root logger/category

###
log4j.rootCategory=DEBUG,dest1


###
# Define non-root loggers/categories

###
log4j.category.ut.log.Log4jPerfTest=DEBUG,dest2
log4j.additivity.ut.log.Log4jPerfTest=false



###
# Define appenders

###
log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.layout=org.apache.log4j.SimpleLayout
log4j.appender.dest1.File=c:/skk/cps/logger/test/test1.log
log4j.appender.dest1.MaxFileSize=4MB
log4j.appender.dest1.MaxBackupIndex=60

log4j.appender.dest2=org.apache.log4j.RollingFileAppender
log4j.appender.dest2.layout=org.apache.log4j.TTCCLayout
log4j.appender.dest2.File=c:/skk/cps/logger/test/test.log
log4j.appender.dest2.MaxFileSize=4MB
log4j.appender.dest2.MaxBackupIndex=60



GENERALLY:
The way to mimic your setup in log4j would be to use AsyncAppender as your
attached appender.  This will create a background thread to handle appending
the actual logging events.

AsyncAppender can only be created from config files using the XML config.
Or you can do it programatically for your tests.

See
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/AsyncAppender.html
for its description.

Also, be aware that the async logging in log4j does still strive to maintain
delivery of generated LoggingEvents to its attached appenders in the
chronological order in which those events were created.  To this end, it
uses a bounded buffer as the queue for these events.  This slows
performance in simple, non-intensive apps; however it does ensure delivery
of the logging events in the correct order.

For a discussion of this see the section on AsyncAppender at
http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/performance/Loggin
g.html


HTH



|-Original Message-
|From: sk k [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, September 03, 2002 9:37 PM
|To: Log4J Users List
|Subject: Re: Performance between Log4j and custom in-house logger
|
|
|
|Hi,
|
|Any thoughts on how I can improve the performance
|numbers for logging.
|
|
|Thanks.
|
|
|--- Ceki Gülcü [EMAIL PROTECTED] wrote:
| 
| What is the difference between Strings, taking the
| values 2,4 and 8,
| and Request, taking the values 100, 1000 and 2000?
| 
| Are you sure you are waiting for the background
| thread to finish?
| 
| Your log4j configuration file suggests that your
| tests use two
| appenders dest1 and dest2. You are aware that
| appenders are additive,
| right?  Does logging output go both
| c:/skk/cps/logger/test/test1.log
| and c:/skk/cps/logger/test/test.log? Given that
| writing to a file is
| the most time consuming task, is it fait to say that
| log4j is doing
| twice the work roughly at the same cost?
| 
| At 07:29 03.09.2002 -0700, you wrote:
| Hi,
| 
| We are planning to move from a custom in house
| logging
| framework (MyLogger) to using Log4j and have been
| doing some performance comparison between log4j and
| MyLogger.
| 
| The numbers seem to be favoring mylogger over
| log4j.
| 
| 
| Sample Numbers
| ==
| Note: Timing includes logj startup time, mylogger
| startup time and junitperf startup time.
| 
| 1) Logging 2 strings, each of size: 128bytes
| 
| Request MyLogger(sec) Log4j(sec)
| ==  ===   =
| 100 1.221.29
| 10001.671.71
| 20002.122.01
| 
| 
| 
| 2) Logging 4 strings, each of size: 128bytes
| 
| Request MyLogger(sec) Log4j(sec)
| ==  ===   =
| 100 1.211.25
| 10001.653   1.82
| 20002.242.56
| 
| 
| 3) Logging 8 strings, each of size: 128bytes
| 
| Request MyLogger(sec) Log4j(sec)
| ==  ===   =
| 100 1.351.35
| 400 1.561.71
| 900 1.8 2.35
| 
| 4) Logging 80 strings, each of size: 128bytes
| 
| Request MyLogger(sec) Log4j(sec)
| ==  ===   =
| 100 1.251   1.7
| 10001.816.1
| 20002.1511.2
| 
| 
| Sample code and 

RE: Log4sh?

2002-09-04 Thread Ebersole, Steven

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]]
|Sent: Wednesday, September 04, 2002 8:44 AM
|To: 'Log4J Users List' (E-mail)
|Subject: Log4sh?
|
|
|I have a process that runs 3 java programs in succession 
|plus some other stuff, within a shell script kicked off by 
|a cron job.  All three java programs log to the same log4j 
|file.  Is there something I can run in the shell script 
|itself to route the raw shell script output to the same 
|file as well?
|
|-
|Steve Cohen
|Sr. Software Engineer
|Ignite Sports, Inc.
|[EMAIL PROTECTED]
|
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Log4sh?

2002-09-04 Thread Ebersole, Steven

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, September 04, 2002 8:44 AM
|To: 'Log4J Users List' (E-mail)
|Subject: Log4sh?
|
|
|I have a process that runs 3 java programs in succession 
|plus some other stuff, within a shell script kicked off by 
|a cron job.  All three java programs log to the same log4j 
|file.  Is there something I can run in the shell script 
|itself to route the raw shell script output to the same 
|file as well?
|
|-
|Steve Cohen
|Sr. Software Engineer
|Ignite Sports, Inc.
|[EMAIL PROTECTED]
|
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: NB 3.2.2 JBoss 3.0.0 Log4J ...

2002-09-03 Thread Ebersole, Steven

Sorry cannot help you.  I will say that I run NetBeans and have had no
issues getting my drivers to load log4j while running in the IDE; of course
I have not tried in the debugger...



|-Original Message-
|From: Martin Welch [mailto:[EMAIL PROTECTED]]
|Sent: Friday, August 30, 2002 11:56 AM
|To: Log4J Users List
|Subject: RE: NB 3.2.2  JBoss 3.0.0  Log4J ...
|
|
|Are you running the JBoss source in debugger?
|
|Yes.
|
|What, if anything, does display in output console?
|
|Nothing :(
|
|-Original Message-
|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?
|
|
||-Original Message-
||From: Martin Welch [mailto:[EMAIL PROTECTED]]
||Sent: Friday, August 30, 2002 11:49 AM
||To: Log4J Users List
||Subject: RE: NB 3.2.2  JBoss 3.0.0  Log4J ...
||
||
||Thanks for your help, Steven.
||
||How are you connecting to the JBoss instance for debugging?
||
||I'm running the source in the debugger.
||
||Where is your log4j property file
||directing output?
||
||To a ConsoleAppender.
||
||Martin
||
||-Original Message-
||From: Ebersole, Steven [mailto:[EMAIL PROTECTED]]
||Sent: 30 August 2002 15:14
||To: 'Log4J Users List'
||Subject: RE: NB 3.2.2  JBoss 3.0.0  Log4J ...
||
||
||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 30, 2002 8:24 AM
|||To: Log4J Users List
|||Subject: Re: NB 3.2.2  JBoss 3.0.0  Log4J ...
|||
|||
|||
|||What is NB 3.2.2?
|||
|||At 14:13 30.08.2002 +0100, you wrote:
|||Hi Folks,
|||
|||I'm trying to get JBoss 3.0.0 to run in NB 3.2.2. I''ve
|||hit a little problem
|||which is that when I step through the source any logging
|||code doesn't appear
|||in the Output Window.
|||
|||I'm quite new to NB and not very familiar with Log4J so
|||it's quite possible
|||that I've overlooked something obvious or I need to
||change a log4j
|||properties file someplace.
|||
|||Can anyone help?
|||
|||Thanks,
|||
|||Martin
|||
|||--
|||Ceki
|||
|||
|||--
|||To unsubscribe, e-mail:
|||mailto:[EMAIL PROTECTED]
|||For additional commands, e-mail:
|||mailto:[EMAIL PROTECTED]
|||
||
||--
||To unsubscribe, e-mail:
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Where does it look for configuration files?

2002-09-03 Thread Ebersole, Steven

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 initialization algorithm is defined as follows: 

Setting the log4j.defaultInitOverride system property to any other value
then false will cause log4j to skip the default initialization procedure
(this procedure). 

Set the resource string variable to the value of the log4j.configuration
system property. The preferred way to specify the default initialization
file is thourough the log4j.configuration system property. In case the
system property log4j.configuration is not defined, then set the string
variable resource to its default value log4j.properties. 

Attempt to convert the resource variable to a URL. 

If the resource variable cannot be converted to a URL, for example due to a
MalformedURLException, then search for the resource from the classpath by
calling org.apache.log4j.helpers.Loader.getResource(resource, Logger.class)
which returns a URL. Note that the string log4j.properties constitutes a
malformed URL. 
See Loader.getResource(java.lang.String) for the list of searched locations.



If no URL could not be found, abort default initialization. Otherwise,
configure log4j from the URL. 
The PropertyConfigurator will be used to parse the URL to configure log4j
unless the URL ends with the .xml extension, in which case the
DOMConfigurator will be used. You can optionaly specify a custom
configurator. The value of the log4j.configuratorClass system property is
taken as the fully qualified class name of your custom configurator. The
custom configurator you specify must implement the Configurator interface. 




|-Original Message-
|From: John C. Turnbull [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, September 03, 2002 1:45 AM
|To: Log4J Users List
|Subject: Re: Where does it look for configuration files?
|
|
|- Original Message -
|From: John C. Turnbull [EMAIL PROTECTED]
|To: [EMAIL PROTECTED]
|Sent: Tuesday, September 03, 2002 5:04 AM
|Subject: Where does it look for configuration files?
|
|
| When I use DOMConfigurator.configure(filename), what 
|rules does it
|follow
| to look for filename?
|
|Specifically I would like to know where it looks for the 
|file when only a
|file name (and not a full path) is specified like 
|john.txt instead of
|C:\john.txt.
|
|-JT
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Scope of logging in an application server

2002-09-03 Thread Ebersole, Steven

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 that server instance.



|-Original Message-
|From: Patrice Thiebaud [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, September 03, 2002 7:46 AM
|To: [EMAIL PROTECTED]
|Subject: Scope of logging in an application server
|
|
|I did the necessary to configure the use of log4j in a WLS 
|enterprise 
|application, using a specific configuration file and 
|specific log file name(s).
|My assumption is that the preferred approach is to have 
|separate logging 
|for each deployed enterprise application and/or 
|stand-alone component.
|
|I would like to know what approaches are generally used in 
|an application 
|server environment.
|
|Thanks in advance.
|
|--
|Patrice Thiebaud - Presales Senior Consultant
|BEA Systems - France
|Tour Manhattan
|6 place de l'Iris
|92095 PARIS La Défense Cédex
|Tel: 33 1 41 45 70 27 Mobile: 06 08 05 95 95
|--
|
|
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: dynamic log file

2002-09-03 Thread Ebersole, Steven

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();
appender.setLayout( new SimpleLayout() );
appender.setFile( /usr/home/peter/logs/myLog.log );
appender.activateOptions();  // This initializes the appender, opening the
File, etc
logger.addAppender( appender );





|-Original Message-
|From: Peter Choe [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, September 03, 2002 2:42 PM
|To: Log4J Users List; Log4J Users List
|Subject: Re: dynamic log file
|
|
|i was looking for something that can be configured 
|programmatically.
|
|something like:
|
|logger.setFile(/usr/home/peter/logs/myLog.log);
|
|but there is no setFile(), right?
|
|Peter Choe
|
|At 02:56 PM 9/3/2002, [EMAIL PROTECTED] wrote:
|
|Pete:
|
|You can use parameter substituion in the configuration 
|file to determine
|the path of the log file(s).  For example:
|
|# A1 is set to be a RollingFileAppender for debugging noise.
|log4j.appender.A1=org.apache.log4j.RollingFileAppender
|log4j.appender.A1.File=${user.debugLog}
|
|
|${user.debugLog} substitutes the value the System 
|Property user.debugLog
|for the log file name.
|
|I am new in the mail group.  Hope I have understood and 
|answered your
|question.
|
|Bill Blalock
|
|
|
| 
|
|   Peter 
| Choe 
|
|   choepete@mindsprTo: 
| [EMAIL PROTECTED]
|   ing.com cc: 
| 
|Subject:  
|dynamic log 
| file
|   09/03/2002 
| 01:54 
|
|   PM 
| 
|   Please respond 
| to 
|
|   Log4J 
| Users 
|
|   List 
| 
| 
|
| 
|
|
|
|
|
|is there a way to tell dynamically where the out put for 
|the log file can
|go?
|
|i want a servlet to read a file parameter which will tell 
|the servlet which
|
|file to use to log output.
|
|Peter
|
|
|--
|To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: NB 3.2.2 JBoss 3.0.0 Log4J ...

2002-08-30 Thread Ebersole, Steven

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 30, 2002 8:24 AM
|To: Log4J Users List
|Subject: Re: NB 3.2.2  JBoss 3.0.0  Log4J ...
|
|
|
|What is NB 3.2.2?
|
|At 14:13 30.08.2002 +0100, you wrote:
|Hi Folks,
|
|I'm trying to get JBoss 3.0.0 to run in NB 3.2.2. I''ve 
|hit a little problem
|which is that when I step through the source any logging 
|code doesn't appear
|in the Output Window.
|
|I'm quite new to NB and not very familiar with Log4J so 
|it's quite possible
|that I've overlooked something obvious or I need to change a log4j
|properties file someplace.
|
|Can anyone help?
|
|Thanks,
|
|Martin
|
|--
|Ceki
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: NotSerializableException using log4j

2002-08-30 Thread Ebersole, Steven

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 with the javax.servlet.http.HttpSessionActivationListener
interface.

HTH



|-Original Message-
|From: Denis McCarthy [mailto:[EMAIL PROTECTED]]
|Sent: Friday, August 30, 2002 10:43 AM
|To: Log4J Users List
|Subject: NotSerializableException using log4j
|
|
|Hi there,
|I'm using log4j in some dataObjects that are stored in 
|each weblogic session
|that a user opens. When the server attempts to serialize 
|the dataObjects in
|the session, the following error occurs (presumably 
|because Logger is not
|serializable)
|Error HTTP Session Could not deserialize session data
|java.io.NotSerializableException: org.apache.log4j.Logger
|at
|java.io.ObjectOutputStream.outputObject(ObjectOutputStream.
|java:1148)
|at
|java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
|at
|java.io.ObjectOutputStream.outputClassFields(ObjectOutputSt
|ream.java:1827
|.
|.
|.
|
|Is there a workaround for this or do I have to take log4j out of my
|dataObjects? Thanks
|Denis McCarthy
|
|
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: creating log file for each user

2002-08-28 Thread Ebersole, Steven

I would not cluster such a solution (we actually have a dedicated logging
server with pooled MDB instances).  The reason is that the clustered MDBs
would really be operating on seperate boxes, and thus there would be
seperate files (i.e., one on each server) with the individual logging events
possibly in any of them.

As a solution to that, you could write a distributed file-access class
(possibly using URLConnection, etc) so that each server instance running the
MDBs could access the same underlying log file.  But that seems to defeat
the purpose of clustering.

HTH



|-Original 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, Steven [EMAIL PROTECTED] wrote:
| 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 
|message-driven EJB
| listening on that destination which decodes the 
|username from the
| LoggingEvent and pushes to the appropriate file.
| 
| Of course, as you mention that is pretty coding 
|intensive (relative 
|to some
| config file driven solution).
| 
| 
| The other options I thought of were as foloows:
| 1) Add explicit entries into your config file for each and every 
|user.  Of
| course this requires that you know in advance all the 
|users of your 
|system.
| Of course you could add in logic to the UseCase of 
|adding a user to 
|the
| system to generate a new entry into the log4j config 
|file, but that
| in-and-of-itself is pretty code intensive.
| 2) If your users are stored in LDAP or a database or some other 
|easily
| accessible format, you can try a manual configuration of 
|log4j for 
|these
| users in a startup class.  This would basically be 
|defining loggers,
| appenders, etc on the fly.
| 3) A custom appender subclassing FileAppender which knows how to
| discriminate the final target file based on the 
|category name of 
|the
| event.  The file defined in the config would be a base directory 
|and the
| appender would simply manage output to seperate files in that 
|directory.
| 
| Just some more ideas.  HTH
| 
| 
| 
| 
| Steve Ebersole
| IT Integration Engineer
| Vignette Corporation 
| 512.741.4195
| 
| Visit http://www.vignette.com
| 
| 
| 
| 
| -Original Message-
| From: Saif Khaja [mailto:ksaif25@h...]
| Sent: Monday, July 01, 2002 1:51 PM
| To: [EMAIL PROTECTED]
| Subject: creating log file for each user
| 
| 
| We have our application running on Websphere with log4j 
|1.1.3. It 
|involves 
| some complicated calculations for each transaction that user 
|performs. Every
| 
| thing goes on fine except that since there is just one 
|common log 
|file, 
| these calculations log statments get intermingled among 
|different 
|users 
| making it hard to debug an issue.
| 
| What I was trying to achieve is a way to create a log 
|file for each 
|user. 
| This way, all complex calculations log statements will 
|be separate 
|for each 
| user making it easier to debug if we have to.
| 
| I did spend quite a while going thru the archives on 
|this issue but 
|couldnt 
| find one. So if this has been discussed already, I 
|apologize for it.
| 
| Among the existing appenders/patterns in log4j, I could use the 
|following to
| 
| achieve the same thing:
| 
| 1. jdbcappender: send the log statements to the database and can 
|query them 
| on each user.
| This would however take too much database space.
| 
| 2. jmsappender: I havent really looked closely at this 
|one yet. But 
|I know I
| 
| could receive the log statements and write some custom 
|code to put 
|each log 
| statement in a separate file based on the user who initiated it.
| 
| 3. xmllayout: Generate xml version of the log file and 
|write xsl to 
|display 
| the log file for requested user.
| 
| I was wondering if there is a quicker/cleaner way or am I just 
|complicating 
| things for myself to achieve this. And if there is none, 
|is there 
|something 
| that is planned in near future

RE: Unix redirection

2002-08-26 Thread Ebersole, Steven

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 log4j config file as
the target for a FileAppender, then this should be fine.

Another option (that I use in my local pre-dev environment) is too have
log4j append to stdout by using the ConsoleAppender, and using the redirect
to send stdout to a file.  That way, both System.out print statements and
log4j logging will show up in the same file.


HTH,
Steve



|-Original Message-
|From: Stephane Nicoll [mailto:[EMAIL PROTECTED]]
|Sent: Monday, August 26, 2002 3:43 AM
|To: Log4J Users List
|Subject: Unix redirection
|
|
|Hi all,
|
|I have a rather simple question. Under linux, I start a 
|Java process with
|unix redirection
|
|
|java com.foo.MyClass notification.log
|
|This is an old stuff and some parts have been updated to 
|log4j. Log4j
|configuration uses notification.log as configuration file.
|
|Is it a problem if log4j and the unix redirectionr () 
|work on the same file?
|
|Thanks and regards,
|
|Stéphane
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: JMS Queue and JMS Appender

2002-08-26 Thread Ebersole, Steven

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 MBeans using the Admin tool.  Specifically, you are
interested in the SET and INVOKE commands.

However, doing this is exactly the same as performing these steps in the
weblogic admin console.  You may want to consider performing the setup as
you want in the console, and then just copying the relevant section(s) from
the config.xml file for that server.




|-Original Message-
|From: sanjayrajsoni [mailto:[EMAIL PROTECTED]]
|Sent: Monday, August 26, 2002 10:24 AM
|To: [EMAIL PROTECTED]
|Subject: JMS Queue and JMS Appender
|
|
|We plan to use JMS Appender in our production environment. 
|We want to 
|automate the creation of Queues and JMS Servers using 
|scripts. I have 
|been paritially successful at this.
|
|I am able to create JMS Conx Factory, JMS File Store and 
|JMS Server 
|using the Commandline, for e.g. 
|
|---
|java -cp d:\bea\wlserver6.1\lib\weblogic_sp.jar;d:\bea\wlserver6.1
|\lib\weblogic.jar weblogic.Admin -username system 
|-password weblogic 
|CREATE -mbean mydomain:Type=JMSServer,Name=testjmss 
|-
|
|How do i target this to a server? 
|
|How do i create Queues for this JMS Server? 
|
|How do i set the directory for JMS Store? Is there a document 
|available somewhere? 
|
|Has anyone does this? 
|
|Thanks in advance. 
|
|
|
|--
|To unsubscribe, e-mail:   
|mailto:[EMAIL PROTECTED]
|For additional commands, e-mail: 
|mailto:[EMAIL PROTECTED]
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Can't control logging via root - get all msgs despite setting priority

2002-07-10 Thread Ebersole, Steven

Sorry, brain-fart, should be:

log4j.rootLogger=ERROR, A1

log4j.logger.myDefinedLogger=DEBUG, A2
log4j.logger.additivity.myDefinedLogger=false






Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://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 to false on the second logger?
|
|You should have something like:
|
|
|log4j.rootLogger=ERROR, A1
|
|log4j.myDefinedLogger=DEBUG, A2
|log4j.additivity.myDefinedLogger=false
|
|
|
|
|
|
|Steve Ebersole
|IT Integration Engineer
|Vignette Corporation 
|512.741.4195
|
|Visit http://www.vignette.com
|
|
|
|
||-Original Message-
||From: Adam Hardy [mailto:[EMAIL PROTECTED]]
||Sent: Wednesday, July 10, 2002 2:19 PM
||To: Log4J Users List
||Subject: Re: Can't control logging via root - get all msgs despite
||setting priority
||
||
||Hi All,
||I've configured the root logger to put all errors  fatals in 
||a log file.
||
||My problem comes when I configure a second logger. My second logger 
||passes all debug  above to the console. However as soon as I 
||configure 
||this second logger, the root logger also sends all debug  
||above to the 
||file.
||
||I can't figure out how to stop this. Can anyone help?
||
||
||Thanks
||Adam
||
||
||--
||To unsubscribe, e-mail:   
||mailto:log4j-user-|[EMAIL PROTECTED]
||For 
||additional commands, e-mail: 
||mailto:[EMAIL PROTECTED]
||
|

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: 3 basic questions

2002-07-08 Thread Ebersole, Steven


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 how to name them ( javadoc says 
|to find in
|propertyconfigurator
|class but i could not)? Or are these predifined if yes where 
|can i find ?
|

I am assuming by keys you mean the values to configure.  The various
pieces of log4j follow a JavaBeans property pattern.  Log4j then uses
standard JavaBean introspection for configuring each defined piece.  In you
example of log4j.appender.A2.file, you have previously defined (in the
config) an Appender named A2 that is some type of FileAppender.
FileAppender has a property named file with appropriate accessors/mutators
(i.e., getFile()/setFile()) methods.  So really you just need to look at the
options available for each individual component you are trying to configure.


|2. I am using log4j in webapplication and configured log4j 
|properties file
|   in it under web-inf\classes dir. I have a statement in 
|mylog.props file
|   log4j.appender.A2.file=service.log
|  when i run the webapplication the service.log file is created under
|tomcat4\bin
|  directory default , Can I specify file in desired location 
|not under bin?
|

service.log is a relative path.  All OS are going to interpret that
particular relative path as ./service.log where . represents the current
working directory which would be ${TOMCAT_HOME}/bin for processes running
inside the Tomcat VM.  But yes you can feed log4j an absolute path and have
it write to anywhere on the filesystem, provided the SecurityManager
currently in use allows it.  Say you want to write the log file to
${TOMCAT_HOME}/myWebApp then do the following (assuming Windows from your
use of the MS-directory seperator):
log4j.appender.A2.file=C:/tomcat4/myWebApp/service.log


|3. As log4j documents say to keep log4j.props file under 
|web-inf\classes
|directory
|   to be identified by servlet, but when the log4j.props file 
|is changed
|that changes
|will not be affected unless tomcat is restarted. Can i keep log4j.props
|under webapps/mywebapp
|directory if so how can i access it in servlet?
|

You can keep the property file somewhere else, but that in and of itself
will not solve your problem of having to restart to have changes recognized.
If it is placed somewhere other than a dir in the classpath, you will need
to tell log4j how to find it either through the log4j.configuration system
property or by programatically using the PropertyConfigurator.configure(...)
method.  In order to have changes to the prop file be automatically
recognized, you will programatically call
PropertyConfigurator.configureAndWatch(...) method.

HTH

|TIA
|/rayaku
|
|-Original Message-
|From: Richard Doust [mailto:[EMAIL PROTECTED]]
|Sent: Monday, 8 July 2002 6:41 AM
|To: Log4J Users List
|Subject: RE: options and different loggers
|
|
|I would hazard a guess that you haven't read much of the 
|material available
|on how to use log4j. Loggers inherit their behavior from a 
|runtime hierarchy
|based on their names. java.util is the parent of java.util.foo 
|and java.util
|is an ancestor of java.util.foo.bar where those dot separated names are
|names of loggers, paramters passed to Logger.getLogger(). Each 
|logger can be
|configured with different appenders and all kinds of stuff. An appender
|knows where its output goes. If your client and your service reside in
|different packages, as one would hope they might, setting them 
|up to log to
|different log files is as simple as setting them up with different
|appenders. Say you have com.rob.client.foo and com.rob.service.bar. By
|establishing loggers in your properties file for com.rob.client and
|com.rob.service, classes from those two packages down to the 
|root (i.e.,
|com.rob.service.bar.ClassA and com.rob.client.ClassB) will log 
|to different
|logfiles if you configure them with different appenders.
|In your properties file, set up as follows:
|
|log4j.logger.com.rob.service=WARN, A2
|log4j.appender.A2=org.apache.log4j.RollingFileAppender
|log4j.appender.A2.file=log/service.log
|log4j.appender.A2.layout=org.apache.log4j.PatternLayout
|log4j.appender.A2.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
|
|log4j.logger.com.rob.client=WARN, A3
|log4j.appender.A3=org.apache.log4j.RollingFileAppender
|log4j.appender.A3.file=log/client.log
|log4j.appender.A3.layout=org.apache.log4j.PatternLayout
|log4j.appender.A3.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
|
|That's about it.
|Rich
|
|-Original Message-
|From: Robert Mark Bram [mailto:[EMAIL PROTECTED]]
|Sent: Sunday, July 07, 2002 6:29 AM
|To: Log4J Users List
|Subject: RE: options and different loggers
|
|
|Howdy Richard!
|
| It means .. snip
| Does that help?
|
|Yes it does, thank you - may I press you for some further 

RE: html format - display method?

2002-07-01 Thread Ebersole, Steven

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 options (check the
documentation for that class). 

HTMLLayout does, but requires you to specify that option in the config.  The
option is simply named LocationInfo, so for an appender named A1, do the
following:
log4j.appender.A1.File=/path/to/file
log4j.appender.A1.layout=org.apache.log4j.HTMLLayout
log4j.appender.A1.layout.LocationInfo=true



-

As for the other issue, that should only occur if you are utilizing multiple
JVMs with the same log4j Hierarchy or if you are spawning Thread objects
which are doing logging.






Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com




-Original Message-
From: Robert Mark Bram [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 29, 2002 8:28 AM
To: Log4j
Subject: html format - display method?


Howdy all!

The original logger classes had the ability to display the method that
called the logging method. Can log4j still do this?

Rob

:)
:-}
;-


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: creating log file for each user

2002-07-01 Thread Ebersole, Steven

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 message-driven EJB
listening on that destination which decodes the username from the
LoggingEvent and pushes to the appropriate file.

Of course, as you mention that is pretty coding intensive (relative to some
config file driven solution).


The other options I thought of were as foloows:
1) Add explicit entries into your config file for each and every user.  Of
course this requires that you know in advance all the users of your system.
Of course you could add in logic to the UseCase of adding a user to the
system to generate a new entry into the log4j config file, but that
in-and-of-itself is pretty code intensive.
2) If your users are stored in LDAP or a database or some other easily
accessible format, you can try a manual configuration of log4j for these
users in a startup class.  This would basically be defining loggers,
appenders, etc on the fly.
3) A custom appender subclassing FileAppender which knows how to
discriminate the final target file based on the category name of the
event.  The file defined in the config would be a base directory and the
appender would simply manage output to seperate files in that directory.

Just some more ideas.  HTH




Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com




-Original Message-
From: Saif Khaja [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 01, 2002 1:51 PM
To: [EMAIL PROTECTED]
Subject: creating log file for each user


We have our application running on Websphere with log4j 1.1.3. It involves 
some complicated calculations for each transaction that user performs. Every

thing goes on fine except that since there is just one common log file, 
these calculations log statments get intermingled among different users 
making it hard to debug an issue.

What I was trying to achieve is a way to create a log file for each user. 
This way, all complex calculations log statements will be separate for each 
user making it easier to debug if we have to.

I did spend quite a while going thru the archives on this issue but couldnt 
find one. So if this has been discussed already, I apologize for it.

Among the existing appenders/patterns in log4j, I could use the following to

achieve the same thing:

1. jdbcappender: send the log statements to the database and can query them 
on each user.
This would however take too much database space.

2. jmsappender: I havent really looked closely at this one yet. But I know I

could receive the log statements and write some custom code to put each log 
statement in a separate file based on the user who initiated it.

3. xmllayout: Generate xml version of the log file and write xsl to display 
the log file for requested user.

I was wondering if there is a quicker/cleaner way or am I just complicating 
things for myself to achieve this. And if there is none, is there something 
that is planned in near future.

Thanks,
Saif.


_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: LocationInfo bug

2002-06-27 Thread Ebersole, Steven

Overloaded methods in the wrapper, or in the log4j consumer?

In log4j consumer (i.e., our code as using the loig4j library) you would
want it to differentiate the overloaded methods (which is does in either the
orignal code or my code).

Overloaded methods in the wrapper should be fine in either case, because it
is the lastIndexOf method used to determine where to start parsing the stack
trace.




Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com




-Original Message-
From: Tumpach, Andrew J [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 11:49 AM
To: Log4J Users List
Subject: RE: LocationInfo bug


Couldn't a similar problem occur with overloaded methods, where one is
called by another?

Andrew

-Original Message-
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.  In the current
LocationInfo.java at line 111, the following is executed:
ibegin = s.lastIndexOf(fqnOfCallingClass);
where 'fqnOfCallingClass' is suppoed to be the Category or Logger or custom
wrapper initiating the logging event.

Now consider the following stack trace from my custom classes (made by
uncommenting line 101 in LocationInfo.java):
s is [java.lang.Exception
at tests.misc.Logger.debug(Logger.java:51)
at tests.misc.Logger.debug(Logger.java:46)
at tests.misc.LoggerGenerator.main(LoggerGenerator.java:84)
].

In my custom classes, my wrapper is tests.misc.Logger so that initial search
(line 111) is really doing:
ibegin = s.lastIndexOf( tests.misc.Logger );

Of course that also matches tests.misc.LoggerGenerator which is the last
line and so no location info is logged when I run this.


The simple work around I did was to modify line 111 as follows:
ibegin = s.lastIndexOf(   + fqnOfCallingClass + . );

The leading space ensures that the above test would not also match
my.tests.misc.Logger.




Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




LocationInfo and Logging wrappers

2002-06-26 Thread Ebersole, Steven

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.  However doing this wrapping will cause the LocationInfo to be
generated incorrectly.  

A simple way around would be to create my wrapper as a subclass of Logger
(creating an appropriate LoggerFactory).  However, I have seen that this
practice is now discouraged.  The only other simple way I can seem to see is
to modify the LocationInfo source to take into account that the actual
location is not the line directly after the name of the Category/Logger in
the stack trace, but is actually X lines after the Category/Logger.

Is there another way I am missing?

If not, any huge pros and/or cons to either approach above?




Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: LocationInfo and Logging wrappers

2002-06-26 Thread Ebersole, Steven

Sweet, thats perfect.  Thanks


Steve Ebersole
IT Integration Engineer
Vignette Corporation 
512.741.4195

Visit http://www.vignette.com




-Original Message-
From: Mark Womack [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 12:57 PM
To: 'Log4J Users List'
Subject: RE: LocationInfo and Logging wrappers


Steve, 

If you are creating a wrapper and you want the correct location info, then
you just need to use the correct value for the caller's FQCN (fully
qualified class name).  Something like this:

public class MyWrapper {
...
private static String FQCN = MyWrapper.class.getName();
...
private Logger logger;
...
/**
  A wrapper method for a debug log message. */
public void debug(Object message) {
logger.log(FQCN, Priority.DEBUG, message, null);
}
...
}

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 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.  However doing this wrapping will cause the LocationInfo to be
 generated incorrectly.  
 
 A simple way around would be to create my wrapper as a 
 subclass of Logger
 (creating an appropriate LoggerFactory).  However, I have 
 seen that this
 practice is now discouraged.  The only other simple way I can 
 seem to see is
 to modify the LocationInfo source to take into account that the actual
 location is not the line directly after the name of the 
 Category/Logger in
 the stack trace, but is actually X lines after the Category/Logger.
 
 Is there another way I am missing?
 
 If not, any huge pros and/or cons to either approach above?
 
 
 
 
 Steve Ebersole
 IT Integration Engineer
 Vignette Corporation 
 512.741.4195
 
 Visit http://www.vignette.com
 
 
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]