-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Nashrul,
nashrul wrote:
| my log4j logging works now, it prints the logs to stdout_20080523.log....
| Actually, I followed the instruction on log4j docs..
| I created initialization servlet, Log4jInit.class, that initializes log4j
| and loaded on startup...
| This initialization class looks like this:
|
| public class Log4jInit extends HttpServlet {
|
| public
| void init() {
| String prefix = getServletContext().getRealPath("/");
| String file = getInitParameter("log4j-init-file");
| // if the log4j-init-file is not set, then no point in trying
| if(file != null) {
| PropertyConfigurator.configure(prefix+file);
| }
| }
I would do "new PropertyConfigurator()" if there is no log4j-init-file
set in the init-params, because it will pick-up log4j.properties from
the classpath. Then you get a reasonable default configuration without
having to add more stuff to your web.xml.
Just my two cents.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkg2zq4ACgkQ9CaO5/Lv0PDU+ACgqZ5Ejr2KG40+Mm/iBHjGO6cd
EwkAoMFrEznVF/Mt4A9CmegdxwD5xDfd
=+oH1
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]