|
Re: Newbie: publishing a file to a tomcat server [message #228702 is a reply to message #228671] |
Mon, 09 March 2009 11:32 |
Eclipse User |
|
|
|
Originally posted by: wknauf_NO_._INSIDE_hg-online.de
Hi Jonathan,
place it in the "src" directory of your web project. Then it will be copied to
"classes".
Best regards
Wolfgang
Jonathan O'Donovan schrieb:
> Hi,
> I have a log4j.properties file that I would like to end up in the
> WEB-INF/classes
> directory after publishing. How do I configure publish to achieve this?
>
> Many thanks,
> Jonathan.
>
|
|
|
Re: Newbie: publishing a file to a tomcat server [message #228709 is a reply to message #228702] |
Mon, 09 March 2009 14:07 |
|
Jonathan,
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
pass to:
ResourceBundle bundle = ResourceBundle.getBundle( "config" );
If you open it for reading by hand, you'd be using a path argument to
such as:
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,
Russ Bateman
Wolfgang Knauf wrote:
> Hi Jonathan,
>
> place it in the "src" directory of your web project. Then it will be
> copied to "classes".
>
> Best regards
>
> Wolfgang
>
> Jonathan O'Donovan schrieb:
>> Hi,
>> I have a log4j.properties file that I would like to end up in the
>> WEB-INF/classes
>> directory after publishing. How do I configure publish to achieve this?
>>
>> Many thanks,
>> Jonathan.
>>
|
|
|
Powered by
FUDForum. Page generated in 0.02555 seconds