OpenWrt Forum Archive

Topic: logread "Failed to find log object: Not found" Chaos Calmer 15.05.1

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to output persistent log files on Chaos Calmer 15.05.01 on a Buffalo WZR-HP-G300NH.

I used exroot to move the root file system to an external usb drive.

Now I'm trying to get the system and kernel log files to log to the drive and so I tried to get this working using the following changes to /etc/config/system based on the documentation here:

config system
    option hostname 'OpenWrt'
    option zonename 'America/New York'
    option timezone 'EST5EDT,M3.2.0,M11.1.0'
    option conloglevel '8'
    option cronloglevel '8'
    option log_file '/mnt/logging/syslog.log'
    option log_size '100000'
    option log_type 'file'

I also did a

touch /mnt/logging/syslog.log

to create the file and then I rebooted to see if anything would end up in the syslog.log file, but nothing has appears there.

When I run

logread -f

I get the error

Failed to find log object: Not found set

I also noticed that there doesn't appear to be a logd running.

(Last edited by leeand00 on 24 Sep 2016, 19:12)

I'm not sure if that's the problem, but you can check it...


http://oi65.tinypic.com/euht13.jpg


The "system" script runs before the "fstab" script and as a result, the file can't be created.
In that case, you can try changing the priority of the system script so that it runs after the fstab.

/etc/init.d/system disable
vi /etc/init.d/system   /*change START=10 to START=50*/
/etc/init.d/system enable

Reboot to test.

(Last edited by angelos on 25 Sep 2016, 11:21)

Wait...how do I know what file it creates?

I tried specifying it in /etc/config/system in the system section by adding option log_file '/var/log/mesages' but there's nothing there...although I believe the logs can be read by running logread now; thanks!

The log option you have added in /etc/config/system is correct.

Execute from the command line (ssh) the quoted commands of my previous post and I think the problem will be solved. If you are not familiar with vi, install nano which is easier to handle.

(Last edited by angelos on 25 Sep 2016, 23:09)

When I changed the setting in /etc/init.d/system, from 10 to 50, the on the first reboot it doesn't come up.  If I reboot it again it does come up.  But in the UI the system service is disabled;  Not sure if it started or not, but I do know this...there's nothing in /mnt/log/sys.log and when I run logread -f I still get the "Failed to find log object: Not found set"

It seems to me like system needs to be pretty early in the start up...after boot of course...and maybe after fstab, but before log...and before alot of other things?

Okay I believe I've got it...

I tried your earlier suggestion...and I've left that as you stated as I believe it was helpful!

But I also discovered that due to my settings in the first post, I did not have enough settings to cause

logread

to read from

logd

so it could write to a file...and the issue I believe was the

log_remote

being set to 1 by default.  I changed this to 0, and now it appears to work with the following final configuration for logging to a file:


config system
        option hostname 'OpenWrt'
        option zonename 'America/New York'
        option timezone 'EST5EDT,M3.2.0,M11.1.0'
        option conloglevel '8'
        option cronloglevel '8'
        option log_file '/mnt/logging/sys.log' # Log to my thumb drive...or some other attached storage...logging to a thumb drive is kinda dumb.
        option log_type 'file'
        option log_size 100000
        option log_buffer_size 2048
        option log_remote '0'  # Need to turn this off to log locally.
#       option log_file '/var/log/messages'

(Last edited by leeand00 on 9 Oct 2016, 01:09)

I dont really know, why angelos suggested to set system to priority 50. That makes no sense to me. System should stay realy early in this chain, so let it stay at 10. If you look in the init.d scripts of system and log, you will also notice, that the system script does nothing with the log values in the system config, log does, which also reads the values from the system config. So in my understanding, it would make way more sense, to set fstab to a priority of 11, after system, and before log. System script just writes router name and sets time btw, nothing else, and this should happen in the first priorities, not at last.

(Last edited by makedir on 10 Dec 2017, 12:58)

The discussion might have continued from here.