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 Mark Gordon <ma...@levelseas.com> on 2001/12/07 15:53:58 UTC

FW: log4j property configuration problem

Hi All

I'm posting this message again, as I didn't get a response. 

Any help from the experts out there greatly appreciated.

Thanks

Mark Gordon

-----Original Message-----
From: Mark Gordon 
Sent: 21 November 2001 10:51
To: 'log4j-user@jakarta.apache.org'
Subject: log4j property configuration problem


Hi All

Tried using the instructions from the Log4j manual on using a servlet for
log4j initialisation. Below is code from the example:

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); 
	} 
}

However getRealPath() doesn't work from within a WAR file. Any suggestions.
I don't want it to be an expanded WAR file, also the solution, if possible,
must be web container independent.

Thanks

Mark 




**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper at LevelSeas for the presence of computer viruses.

**********************************************************************

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>