I'm not sure why what you have wouldn't work? However, the double backslashes
are unnecesary (and could, possibly, be breaking things). They tie the config
file to a windows box. Just use single forward slashes. This will work on
both Windows and UNIX systems.
BTW, wasn't the point to set the REL_PATH propery in code, not in the config
file?
Jake
Quoting Konrad Billewicz <[EMAIL PROTECTED]>:
> > I had to tweak the code a bit but now it works like a charm. Thanks for
> getting me on the right track. You made my
> > day. I'll post my solution below for others. This block sits in a servlet.
>
> I tried to run this code but it's not working in my case. I'm getting the
> same
> error as when I tried to do it on my own.
>
> java.io.FileNotFoundException: WEB-INF\logs\exceptions.log
>
> Java code is exactly as yours and my properties file:
>
> # REL_PATH=C:\\workspace\\msz\\web\\
> log4j.logger.pl.akonet.framework.Servlet=DEBUG, EXCEPTIONS
> log4j.appender.EXCEPTIONS=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.EXCEPTIONS.DatePattern='.'yyyy-MM-dd'.log'
> log4j.appender.EXCEPTIONS.File=${REL_PATH}WEB-INF\\logs\\exceptions.log
> log4j.appender.EXCEPTIONS.layout=org.apache.log4j.PatternLayout
> log4j.appender.EXCEPTIONS.layout.ConversionPattern=%d{HH:mm:ss dd-MM-yyyy}
> %-5p
> @ %C{1}:%M:%L - %m%n
>
> When I uncomment first line everything works fine. I checked in debuger that
> REL_PATH key is present in props when invoking PropertyConfigurator.
> configure(props). What is going on?
>
> Best regards,
> Konrad Billewicz
>
>
>
> ---------------------------------------------------------------------
> 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]