WebFaction
Community site: login faq

I see log files under /user/frontend and /user/logs with the name myapp_error.log and myapp_access.log Sometimes the access log can become huge. Is there a way to define a maximum size, for a single log file, and to create a new log file when the current file reaches to that size?

asked 03 Dec '16, 19:18

clip
138
accept rate: 0%


WebFaction automatically rotates logs on a daily basis in ~/logs/frontend. You can use 'logrotate' with your own custom configuration file somewhere within your home directory for custom logging in '~/logs/user', or some other path. I believe there is a 'size' or 'hourly' option to break up the logs. Use 'man logrotate' for more details on it's usage. That or some other logging method would need to be implemented. Hope this helps.

permanent link

answered 03 Dec '16, 22:35

NickR ♦♦
4165
accept rate: 18%

I've tried to create a logrotate.conf file like this:
/home/myuser/logs/user/*log /home/myuser/logs/frontend/*log { rotate 7 daily size 50M } and then run the command logrotate /home/myuser/logrotate.conf
But I'm getting this error:
error: error creating output file /var/lib/logrotate.status.tmp: Permission denied

(07 Dec '16, 08:43) clip

You need to select a state file, in a location that your user can write, for example /home/myuser/logrotate.status.

You can use the -s option when running logrotate. See the command's man page for more info.

(08 Dec '16, 19:05) iliasr ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×225
×28

question asked: 03 Dec '16, 19:18

question was seen: 1,343 times

last updated: 08 Dec '16, 19:05

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM