1

I´m creating a Web Service using Glassfish. Now I want to know basic information about my requests like:

[DATE] "GET / HTTP/1.0" 200

For that I installed apache 2.2. It has 3 logs: access.log, error.log and install.log. How can I known basic information of my application using access.log?In other words, How can I direct my application requests to access log?

Goldbones
  • 1,407
  • 3
  • 21
  • 55
  • is apache configured as reverse proxy ? and what kind of application related information are you trying to check ? – Kannan Mohan Jan 29 '15 at 14:29
  • Basically I want to know session id, date and type of request (200, 404) and if possible the time for each request. I configured apache server as default using hostname an port 80. I don t know nothing more about apache – Goldbones Jan 29 '15 at 14:58

1 Answers1

0

If you need session id, date, HTTP status code and other important log information update below directive in your apache configuration file.

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" \"%{Set-Cookie}o\"" more_logs
CustomLog ${APACHE_LOG_DIR}/access.log more_logs

Here "%{Set-Cookie}o\" will enable logging of sessions.

If you still need more log information refer this documentation.

Kannan Mohan
  • 1,810
  • 12
  • 15
  • But this will allow me to have my applications requests on access log? My access log is not catching anything at this time. – Goldbones Jan 29 '15 at 23:59
  • Yes the above configuration should work. Check if u have updated them correctly and see if any duplicate configuration exists and remove it. Dont forget that these settings have to be added to apace's main configuration file. – Kannan Mohan Jan 30 '15 at 01:55