Score:0

Nginx access log file in every x minute

in flag

I need to read the access log from nginx, do some post processing and send it as a csv to another server. But by default nginx generates access log in one single file. Is there any way to create the access log files every x minute? for example x=10 minute

access.log.2022-01-31-08-10.log
access.log.2022-01-31-08-20.log
access.log.2022-01-31-08-30.log

Help will be appreciated. Thanks!

Score:1
us flag

Your operating system has a specific utility for log rotation. In Linux it is logrotate.

You need to configure it to rotate logs at the frequency you want.

Beware that too frequent log rotation might have performance effects, especially if you let the log files stay in the same directory.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.