You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Joe Sackett <jo...@sackett.com> on 2001/09/16 22:26:05 UTC
Log4j logging for Orion EJBs
Hello,
I am considering using log4j as our logging mechanism for EJBs
deployed in Orion 1.5.2. I appreciate all of the up-front logging
model provided by the Category and Priority intersections.
My concern is that some Appenders may not work well within an EJB
container. I considered and ruled-out the console, remote server,
Unix Syslog daemon, JMS listener, NT EventLog and e-mail types
for various reasons specific to our application. I would like the
log4j output to go to a log file, but know this may violate the EJB spec.
Could someone please make a suggestion on how log4j can
write to a file from an Orion-hosted EJB or refer me to a related
archived posting or discussion thread.
Thank you in advance,
- Joe
joseph@sackett.com
Re: Log4j logging for Orion EJBs
Posted by Eddie <po...@hotmail.com>.
Hellu,
I use log4j very well with Orion... I have no problem logging from the EJB into a file..
The point is that you are not allowed to write directly from a file/read from a file in a EJB.
So, what you do is, tell the Log4j Category class to log a entry. The Category class than writes, through the apropiate appenders in for example a file So the EJB doesn't write in the file directly.
I use a RollingFile and SMTP appender and it works great.
PS:
1: the same is true for reading for example file properties: call another class that returns our properties, stored in files.
2: Use on log.properties file for all your J2EE applications, otherwise you sure get into problems, as log4j uses static variables/methods and it is hard, and unnecessary, to use one log4j-core.jar for every J2EE appication. It works even quite well to have one log4j engine/ config file..
Good luck,
Ed
----- Original Message -----
From: Joe Sackett
To: log4j-user@jakarta.apache.org
Sent: Sunday, September 16, 2001 10:26 PM
Subject: Log4j logging for Orion EJBs
Hello,
I am considering using log4j as our logging mechanism for EJBs
deployed in Orion 1.5.2. I appreciate all of the up-front logging
model provided by the Category and Priority intersections.
My concern is that some Appenders may not work well within an EJB
container. I considered and ruled-out the console, remote server,
Unix Syslog daemon, JMS listener, NT EventLog and e-mail types
for various reasons specific to our application. I would like the
log4j output to go to a log file, but know this may violate the EJB spec.
Could someone please make a suggestion on how log4j can
write to a file from an Orion-hosted EJB or refer me to a related
archived posting or discussion thread.
Thank you in advance,
- Joe
joseph@sackett.com