So based on this, what is the easiest way to log for EJB's?

One of the things I liked about log4j was it's simplicty...  I am not really
looking forward to using some of the other methods like JMSAppender etc...
Next to the FileAppender, what is the simplest way of logging...  Database
maybe?  

Could I create an Entity Bean that was an appender that would write to my
database...?

Eric

-----Original Message-----
From: John Brunton [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 9:41 AM
To: LOG4J Users Mailing List
Subject: RE: log4j, EJB, J2EE RI


The application accessing the EJB stops with an exception:

java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
        java.rmi.RemoteException: Unknown exception: ; nested exception is:
java.rmi.ExceptionInInitializerError
java.rmi.RemoteException: Unknown exception: ; nested exception is:
        java.lang.ExceptionInInitializerError:
java.security.AccessControlException:
        access denied (java.io.FilePermission E:/dev/log4j/Root.log write)

I suppose you could change the permissions in the java.policy file to allow
writes to the log files.

But, I don't think that would be a good idea.

(It would be very easy to start down that path...)





-----Original Message-----
From: Pugh, Eric [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 8:59 AM
To: 'LOG4J Users Mailing List'
Subject: RE: log4j, EJB, J2EE RI


When you get fileaccess errors...  Does the EJB have problems, or just
logging?

I am using FileAppender in a bunch of non EJB applications...  I want to add
it to some EJB objects, and I don't mind if a message gets lost here or
there....  The app doesn't get a lot of use, so the chances of two
people/processes trying to write to the same file is fairly low....

So, does the logger fail cleanly, or does it fail messily?

Eric

-----Original Message-----
From: Kitching Simon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 4:38 AM
To: 'LOG4J Users Mailing List'
Subject: RE: log4j, EJB, J2EE RI


Hi John,

It has been mentioned several times
on this list that the FileAppender really
shouldn't be used for EJB development.
FileAppender isn't designed for
multiple processes writing to the
same file, and (as you have seen)
there are also security/access issues
with creating a file on disk.

I suggest using the SocketAppender,
JMSAppender, DatagramStringAppender
(see contribs dir), or write an appender
that forwards log messages to the
logging api that comes with your EJB engine.

Note that I haven't used log4j with EJBs myself .

Regards,

Simon

> -----Original Message-----
> From: John Brunton [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, February 26, 2001 10:59 PM
> To:   log4j-user @jakarta.apache.org
> Subject:      log4j, EJB, J2EE RI
>
> Being new to the log4j community, I find using log4j a little difficult at
> times. At present, I am able to log messages, etc using the FileAppender,
> except from within an EJB running under the J2EE RI. I get the dreaded
> java.security.AccessControlException: access denied for my log file.
>
> What are my options as I need to be able to log from within an EJB?
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to