Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom log with php execution time #1616

Open
ufo56 opened this issue Nov 29, 2019 · 1 comment
Open

Custom log with php execution time #1616

ufo56 opened this issue Nov 29, 2019 · 1 comment

Comments

@ufo56
Copy link

@ufo56 ufo56 commented Nov 29, 2019

Hi

My apache2 logs also time that takes to execute php request.

domain xx.xx.xxx.xxx - - [25/Nov/2019:00:00:00 +0200] "GET /link/calculator/calculate?amount=1139.00 HTTP/2.0" 200 119 "https://domain/link/link/" "Mozilla/5.0 (Linux; Android 9; EML-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36" (60642713-6.779)

At moment i use --log-format='%v %h %^ %^ [%d:%t %^] "%r" %s %b "%R" "%u" "%^"%^ %^'
Last number on line is time that takes to execute this php script. (6.779) Before that is just process id.

Is it possible to log that time into goaccess ? I see that there is options to log that time but i can't figure out correct log-format

%DThe time taken to serve the request, in microseconds.
%TThe time taken to serve the request, in seconds with milliseconds resolution.
%L The time taken to serve the request, in milliseconds as a decimal number.

EDIT: Asked to soon help here. --log-format='%v %h %^ %^ [%d:%t %^] "%r" %s %b "%R" "%u" "(%^-%T)"' Seems to be correct answer :)

@allinurl

This comment has been minimized.

Copy link
Owner

@allinurl allinurl commented Nov 29, 2019

This should do it:

goaccess access.log --log-format='%v %h %^ %^ [%d:%t %^] "%r" %s %b "%R" "%u" %^-%T)' --date-format=%d/%b/%Y --time-format=%T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.