SLF4J on Java Google App Engine

This article suggest a recipe to configure SLF4J on Google App Engine for Java.

This article was first published at techtavern.wordpress.com

Google App Engine for Java offers a restricted Java 6 API, which includes just the cumbersome Java Utils Logging. Fortunately, SLF4J works as well. The recipe is the standard one. Nearly no configuration is required.

Just add following SLF4J libraries into the applications WEB-INF/lib directory: slfj4-api-1.7.7.jar and slf4j-jdk14-1.7.7.jar (version number may vary). This will redirect all your SLF4J logging statements to the Java Utils Logging controlled by the App Engine.

Optionally you may also add jcl-over-slf4j-1.7.7.jar and log4j-over-slf4j-1.7.7.jar libraries, that will redirect both Apache Commons Logging and Log4J to SLF4J (and thus to App Engine’s Java Utils Logging).

2 Responses to SLF4J on Java Google App Engine

  1. Jeff Evans says:

    Slight correction: the 2nd library is called “slf4j-jdk14” with a “j” instead of “s” as written here. See: http://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: