Monday, April 23, 2012

WebLogic HTTP access.log not being written

(aka How To Change the Buffer Size for the WebLogic Server Http Access Log [ID 1113583.1] )

HTTP access logs are buffered for performance reasons.
By default logs are buffered until reaching 8kb when they are flushed to the file.
You can configure this buffer - if set to zero then logs will be written immediately.


The HTTPAccessLog could sometimes not be viewed from the console.
Solution:
The LogFileMBean now includes a buffer-size-kb parameter. This parameter has a default value of 8 KB; when set to zero or less, it will not buffer the log messages.
For example, to set the buffer size for access.log in config.xml:

<server>
...
<web-server>
<web-server-log>
<buffer-size-kb>0</buffer-size-kb>
<web-server-log> See also LogFileFlushSecs, which is deprecated and no longer available: http://docs.oracle.com/cd/E17904_01/apirefs.1111/e13945/weblogic/management/configuration/WebServerMBean.html#setLogFileFlushSecs%28int%29 so your only chance it to change the BufferSize

edit()
startEdit()
cd /Servers/osbdv2ms1/WebServer/osbdv2ms1/WebServerLog/osbdv2ms1
set('BufferSizeKB',1)
save()
activate()



No comments: