Log size

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
rseiler
Posts: 208
Joined: Sun Dec 15, 2013 12:31 am

Log size

Post by rseiler »

There's a long history of confusing discussions about this over on OpenWRT, but does anyone know what the current situation is with logd here in terms of a) increasing the log size from the default of 16KB, and b) actually being able to read larger sizes assuming they exist (there was some discussion about logread not going past 45KB)?

The control for this (short of editing /etc/init.d/log, which I don't think is a good idea) seems to be /etc/config/system ('system' section). There you can add lines like:

option log_buffer_size '32'
option log_size '32'

What is the difference between those two? I have no idea, but I think the first one may be the right one, since when you add just that line you can see the direct effect in memory in the logd process when you run 'ps' (assuming you restart logging: "/etc/init.d/log restart").

(It changes from -S 16 to -S 32.)

And then there's logread itself, which has this switch for some reason. Why would a logreader need to be provided the size of what it's about to read? Clearly I'm missing something.
-S <bytes> Log size

Anyway, if anyone has a handle on this, it would be great to clear all this up.

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Log size

Post by Lantis »

log_buffer_size sets the ring buffer (RAM) size that the system logs to. This is affecting "logd"
log_size sets the file size of logs going to a file. This is acting on "logread".

You definitely want to modify these using the system config. Not by modifying init scripts.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

rseiler
Posts: 208
Joined: Sun Dec 15, 2013 12:31 am

Re: Log size

Post by rseiler »

OK, so for the purposes of the System log menu (which may or may not use logread, it's hard to tell) and the Email plugin (which definitely does), would the first command be sufficient?

For the log to be written to a file, I thought "option log_file '/var/log/syslog'" was necessary. That's not a default line, however, and I doubt many use it.

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Log size

Post by Lantis »

They both use logread yes.

Yes I believe so. If you're trying to increase the number of lines logread outputs then increasing the ring should do that.
Test and see i reckon

Correct you need that line to point it at a file.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply