add checksum to nginx log entries

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

add checksum to nginx log entries

wld75
Hi,
I'm wondering if there is a ready way to add a checksum (e.g. CRC) to the
end of each log entry before they get written to the "access" or "error" log
files?  One of the project I work on wants each log line to have its own
checksum for some integrity checks.

Any hint on how I can implement these would be of great help.

Thanks,
Cheers,
Prasanna

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,281078,281078#msg-281078

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: add checksum to nginx log entries

Francis Daly
On Mon, Sep 03, 2018 at 09:26:42AM -0400, prajos wrote:

Hi there,

> I'm wondering if there is a ready way to add a checksum (e.g. CRC) to the
> end of each log entry before they get written to the "access" or "error" log
> files?

I believe that stock nginx does not include a way to do that.

> One of the project I work on wants each log line to have its own
> checksum for some integrity checks.

What kind of corruption is the checksum intended to protect against?

The answer to that might help determine a suitable design for a solution
for you.

> Any hint on how I can implement these would be of great help.

If it is acceptable to be outside nginx, you could have something that
post-processed the logs to add whatever marks you want.

Or maybe you could write nginx logs to a named pipe, and have another
process do whatever you want before writing to "real" disk.

Good luck with it,

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx