IBM Support

Configuring an Access_log for your IBM HTTP server.

Question & Answer


Question

How do I get an access_log for my HTTP server?

Cause

If you do not choose to have an access_log when you created your HTTP server, you will have to add it manually if you decide you want it later.

Answer

When you create an HTTP server from the Web Administration GUI it will give you the option to have an access_log. If you do not select the option for an access_log and later you decide you want one, then you will have to add it manually.

Add the following directives in the global area of your HTTP configuration file if they do not already exist:

LogFormat "%h %T %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{Cookie}n \"%r\" %t" cookie                                             
LogFormat "%{User-agent}i" agent                                                    
LogFormat "%{Referer}i -> %U" referer                                               
LogFormat "%h %l %u %t \"%r\" %>s %b" common        
CustomLog logs/access_log combined   
LogMaint logs/access_log 7 0         
LogMaint logs/error_log 7 0    

You will have to stop and restart the HTTP server for the change to take effect using the "ENDTCPSVR *HTTP HTTPSVR(<instance>)" and "STRTCPSVR *HTTP HTTPSVR(<instance>)" commands. The log will be located in the servers directory: /www/<myserver>/logs

It can also be customized from the Web Administration GUI by clicking on Logs and then selecting the Custom Logs tab.


[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CGqAAM","label":"IBM i HTTP Server"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Document Information

More support for:
IBM i

Component:
IBM i HTTP Server

Software version:
All Versions

Operating system(s):
IBM i

Document number:
706795

Modified date:
04 October 2024

UID

nas8N1020809

Manage My Notification Subscriptions