|Re: Newbie: publishing a file to a tomcat server [message #228702 is a reply to message #228671]
||Mon, 09 March 2009 11:32
Originally posted by: wknauf_NO_._INSIDE_hg-online.de|
place it in the "src" directory of your web project. Then it will be copied to
Jonathan O'Donovan schrieb:
> I have a log4j.properties file that I would like to end up in the
> directory after publishing. How do I configure publish to achieve this?
> Many thanks,
|Re: Newbie: publishing a file to a tomcat server [message #228709 is a reply to message #228702]
||Mon, 09 March 2009 14:07
| Russell Bateman
Registered: July 2009
Location: Provo, Utah, USA
You can certainly place a file like "mystuff.properties" in a directory
under "src", like "config" or "properties", etc. if you find that to be
better organization. Where you put it will influence the arguments you
ResourceBundle bundle = ResourceBundle.getBundle( "config" );
If you open it for reading by hand, you'd be using a path argument to
File f = new FileInputStream( "src/config/mystuff.properties" );
but that's from Eclipse during testing from Run As... or Debug... and
would be different once deployed (one reason to use getBundle()).
It's vaguely confusing at first; I know because I've only learned this
in the last few months. And, I'm probably still confused on many points.
In your case, it's the file controlling how logging works. That's
already set up in my app and I didn't do that aspect of it, so you'll
have to consult the log4j documentation on how to accommodate placing
this file in a subdirectory, but directly under "src" is one of the
places Loader.getResource( String ) looks for that file when it's opened
and read by log4j. See http://logging.apache.org/log4j/1.2/manual.html
about 3/4 of the way down the page.
Best of luck,
Wolfgang Knauf wrote:
> Hi Jonathan,
> place it in the "src" directory of your web project. Then it will be
> copied to "classes".
> Best regards
> Jonathan O'Donovan schrieb:
>> I have a log4j.properties file that I would like to end up in the
>> directory after publishing. How do I configure publish to achieve this?
>> Many thanks,
Powered by FUDForum
. Page generated in 0.01723 seconds