soapergem
soapergem

Reputation: 9989

How do I enable Tomcat access logs in Grails 3?

I am trying to enable access logs on the embedded Tomcat container in a Grails 3 app. I've already confirmed that the one-line-access-log plugin is not sufficient for my purposes (certain resources being accessed - such as assets - don't get logged by that plugin).

I found some guides recommending you add this property to the application.groovy file:

server.tomcat.accesslog.enabled = true

However that doesn't seem to do anything. Then I found other guides recommending the use of eventConfigureTomcat in _Events.groovy, however that seems to be a Grails <=2 paradigm.

What is the correct way to configure Tomcat to enable access logs in Grails 3?

Upvotes: 1

Views: 401

Answers (1)

Joe
Joe

Reputation: 1219

Below is a way to get addition detail from Tomcat errors when starting a Grails application. Have used this a number of times.

SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file

To get the listener failed to start errors from Tomcat. Go to your WEB-INF/classes directory, create file logging.properties with the following content and restart the tomcat server.

org.apache.catalina.core.ContainerBase.[Catalina].level=INFO org.apache.catalina.core.ContainerBase.[Catalina].handlers=java.util.logging.ConsoleHandler

Upvotes: 1

Related Questions