logging configuration

12 views
Skip to first unread message

Daryl Stultz

unread,
Sep 7, 2010, 8:59:06 AM9/7/10
to Ebean ORM
Hello,

I'd like to specify that log files go to a folder under my web
application say /path/to/webapp/WEB-INF/logs. I see this:

ebean.log.directory=${catalina.base}/logs/trans

Is there some expression for the web application base (/path/to/webapp
in this case)? If not, how should I go about setting one? The value
should be limited to the scope of the web application, of course, so I
can have more than one Ebean application each with its own log
directory.

Thanks.

/Daryl

Rob Bygrave

unread,
Sep 8, 2010, 6:13:55 AM9/8/10
to eb...@googlegroups.com
>>  Is there some expression for the web application base

No (not that I am aware of).

I believe you effectively what a variable that would be the result of:

servletContext.getRealPath("/");

... if that was called "servlet.realpath" then we could use:
 
ebean.log.directory=${servlet.realpath}/WEB-INF/logs

.... I'll have a look.

Daryl Stultz

unread,
Sep 8, 2010, 8:44:33 AM9/8/10
to Ebean ORM

On Sep 8, 6:13 am, Rob Bygrave <robin.bygr...@gmail.com> wrote:
> servletContext.getRealPath("/");

I can handle determination of the path to the webapp in my servlet
startup code. But where do I set this value so it is not JVM global
(only specific to app) and Ebean can read it?

Thanks.

/Daryl

Rob Bygrave

unread,
Sep 9, 2010, 2:03:09 AM9/9/10
to eb...@googlegroups.com

I was looking at this last night... and right now you can't really do it (because as you point out the other scopes are JVM wide).

I was making some changes to Ebean's GlobalProperties and friends which should address this as they are scoped via the webapp classloading to be per webapp.

So with a bit of luck I'll address this issue late tonight.

Rob Bygrave

unread,
Sep 9, 2010, 6:45:14 AM9/9/10
to eb...@googlegroups.com
Logged as http://www.avaje.org/bugdetail-318.html

If you register in the web.xml the com.avaje.ebeaninternal.server.core.ServletContextListener ... then it will set the servlet.realpath parameter for you.  Otherwise you can calculate and set the value yourself via GlobalProperties.put() and GlobalProperties.evaluateExpressions().

Code in HEAD now.

Daryl Stultz

unread,
Sep 9, 2010, 8:05:55 AM9/9/10
to Ebean ORM

On Sep 9, 6:45 am, Rob Bygrave <robin.bygr...@gmail.com> wrote:
> Logged ashttp://www.avaje.org/bugdetail-318.html

Thanks, Rob!

/Daryl
Reply all
Reply to author
Forward
0 new messages