Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make nginx error logs in JSON instead of its default logging format?

Tags:

nginx

I need to display statistics from log files on my custom GUI. The log files are expected to be huge so parsing them manually would be overkill. However, if there is a way to output the error logs in JSON instead of simple text, it could save a lot of time.

Is there a way to do that? can we set custom log format for error_log?

like image 950
Naveen BT Avatar asked Oct 15 '22 02:10

Naveen BT


1 Answers

Correct, as of my knowledge, error log can not have json & custom format. however, access log can have the same.

like image 176
Soman Dubey Avatar answered Oct 22 '22 09:10

Soman Dubey