How to configure Log4j (using Appenders) logging correctly with Application Server (Doc ID 1011323.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle GlassFish Server - Version 8.1 to 9.1 [Release 8.1 to 9.1]
All Platforms
***Checked for relevance on 21-Apr-2014***

Goal

Platform : All (Generic)
Version : Application Server 8.x (Verified on SE/EE), also applicable to Application Server version 9.

Primary Issue :

A large Application Server Customer, who is using LOG4J bundled with an
Application, deployed on SJSAS EE 8.1_02 running on Windows 2003,observed the
following below errors :

Error Message 1 :

[#|2007-04-08T08:54:52.312+0800|WARNING|sun-appserver-ee8.1_02|javax.enterprise.system.stream.err|
_ThreadID=10;|log4j:ERROR setFile(null,true) call failed.|#]

[#|2007-04-08T08:54:52.359+0800|WARNING|sun-appserver-ee8.1_02|javax.enterprise.system.stream.err|
_ThreadID=10;| java.io.FileNotFoundException: ..\..\logs\pq\pqweb.log
(The system cannot find the path specified)

Error Message 2 :

[#|2007-04-08T08:54:52.312+0800|WARNING|sun-appserver-ee8.1_02|javax.enterprise.system.stream.err|
_ThreadID=10;|log4j:ERROR setFile(null,true) call failed.|#]

[#|2007-04-08T08:54:52.359+0800|WARNING|sun-appserver-ee8.1_02|javax.enterprise.system.stream.err|
_ThreadID=10;| java.io.FileNotFoundException: ..\logs\ab\abc.log
(No such file or directory)

Eventually the server log size kept on increasing and finally the Application
Server used to Hang. Customer faced this issue again and again even after
repeated killing of Application Server - S/he needed the RCA (Root Cause
Analysis) and resolution/workaround to overcome this issue.

Purpose of Document :

Currently there is NO documentation which describes how to resolve i.e
configure Log4j (using appenders) logging correctly and proven various working
workaround to resolve such Errors.

This Tech Doc is to address that aspect.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms