Authorization and Log Level Change

LogDigger servlet library v0.3 has been released today with two new features:

Change of Log Levels

Until now, LogDigger was not able to catch log events with level that is lower than configured by Log4j configuration. This is still default behavior with “[server]“ level setting in Firefox extension. However, user now can set any log level in Firefox and receive all events regardless how levels are configured in default configuration.

This logging level is isolated to user’s HTTP request only and does not affect other appenders in Log4j configuration.

Authorization Interface

Authorization interface have been provided to allow use of LogDigger only if certain conditions are met, making LogDigger usable in production environments.

Provided SimpleAuthorizer implementation can filter requests depending on presence of a session attribute, remote IP address or host name (as regular expression). Authorizer is configured using LogDigger servlet filter confoguration:

<filter>
<filter-name>LogDigger Servlet Filter</filter-name>
<filter-class>org.logdigger.servlet.filter.LogDiggerServletFilter</filter-class>
<init-param>
<param-name>authorizer</param-name>
<param-value>org.logdigger.servlet.filter.SimpleAuthorizer</param-value>
</init-param>
<init-param>
<param-name>simpleAuthorizer.hasSessionAttribute</param-name>
<param-value>USER_DATA</param-value>
</init-param>
<init-param>
<param-name>simpleAuthorizer.remoteHost</param-name>
<param-value>hostname</param-value>
</init-param>
<init-param>
<param-name>simpleAuthorizer.remoteIP</param-name>
<param-value>192.168.1.[1-9]*</param-value>
</init-param>
</filter>

Authorizer interface documentation can be found in the servlet filter distribution.

{ 1 comment }

martin January 8, 2009 at 4:16 pm

The original post listed “simpleAuthorizer.hasSessionParameter” as a parameter name instead of “simpleAuthorizer.hasSessionAttribute”.

Credits to Péter Szántó for spotting and reporting this.

Comments on this entry are closed.

Previous post:

Next post: