[Master] Configuring Access Logs in Red Hat Middleware Products.

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
  • Red Hat Enterprise Linux (RHEL)
  • Red Hat Software Collections (RHSCL)
  • Red Hat JBoss Web Server (JWS)
  • Red Hat JBoss Core Services (JBCS)
  • Apache HTTPD
  • Apache Tomcat
  • NGINX Web Server

Issue

  • How to enable friendly access log times in JBoss EAP?
  • How to enable friendly access log times in Apache HTTPD?
  • How to enable friendly access log times in Apache Tomcat?
  • How to enable friendly access log times in NGINX?

Resolution

The default access log timing in Apache HTTPD, Tomcat, and JBoss EAP are in milliseconds and are not conducive to quickly identifying high access times, or for easily tracing through the flow of a request from HTTPD to EAP using mod_jk, for example.

One approach that has worked well in modifying the default configuration is to add a Time Taken string to the log pattern followed by the request time in seconds and milliseconds.

As well as other information such as cookies, request headers, process ID, thread ID, etc. Each server has different configuration and arguments to do it and here is the list with solutions for each server and its version:

For EAP 4.x / 5.x

Refer How to enable access logging for JBoss EAP 4 or 5?

For EAP 6.x

Refer How to enable access logging for JBoss EAP 6

For EAP 7.x

Refer How to enable access logging for JBoss EAP 7?

For Apache HTTPD

Refer How to customize the access log in Apache HTTPD?

For NGINX

Refer How to customize the access log in NGINX?

For Apache Tomcat

Refer How to enable access log in Apache Tomcat?

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

3 Comments

How to configure to send access logs to console?

Hi Purushotham,

You would need to start your application in the foreground (from your terminal using the catalina.sh/standalone.sh/httpd). However, if you need further assistance on this, I recommend opening a support case.

Thanks, Robert

Hi Robert, Is it possible when JBoss EAP runs in the background (started as a process) ? Thx, Purshi