metropt
1
I have setup the system log to write the logs to a external device but I don't get any logs on the external device.
Can you help me?
config system
option hostname 'OpenWrt'
option ttylogin '0'
option log_size '200000'
option urandom_seed '0'
option zonename 'UTC'
option log_proto 'udp'
option log_file '/mnt/sda1/logs/system.log'
option log_remote '0'
option conloglevel '7'
option cronloglevel '7'
Is the external device mounted?
ubus call system board
mount
df -h
1 Like
So it does what it's supposed to, good on you, problem solved ?
It is mounted and I have it being used by docker per example.
Sorry for my English. I’ve edited the first post, so it should be clear now.
_bernd
6
I have to write at least 10 char to be able to send a post...
metropt
7
It looks like logread is not running after reboot. root@OpenWrt:~# ps w | grep -E '[l]ogread.-f.-F'root@OpenWrt:~#
If I do /etc/init.d/log restart it starts logging to the file.
It looks like it isn’t working because disk is not mounted at the time logread is started.
Is it not possible to log to a external device from the begining?
EDIT:
root@OpenWrt:~# ubus call service list '{"name":"log"}'
{
"log": {
"instances": {
"logd": {
"running": true,
"pid": 608,
"command": [
"/sbin/logd",
"-S",
"200000"
],
"term_timeout": 5,
"respawn": {
"threshold": 5,
"timeout": 1,
"retry": -1
}
}
}
}
}
root@OpenWrt:~# /etc/init.d/log restart
root@OpenWrt:~# ubus call service list '{"name":"log"}'
{
"log": {
"instances": {
"logd": {
"running": true,
"pid": 3952,
"command": [
"/sbin/logd",
"-S",
"200000"
],
"term_timeout": 5,
"respawn": {
"threshold": 5,
"timeout": 1,
"retry": -1
}
},
"logfile": {
"running": true,
"pid": 3953,
"command": [
"/sbin/logread",
"-f",
"-F",
"/mnt/sda1/logs/system.log",
"-p",
"/var/run/logread.1.pid",
"-S",
"200000"
],
"term_timeout": 5
}
}
}
}
root@OpenWrt:~# cat /etc/config/system
config system
option hostname 'OpenWrt'
option ttylogin '0'
option log_size '200000'
option urandom_seed '0'
option zonename 'UTC'
option log_proto 'udp'
option log_type 'file'
option log_file '/mnt/sda1/logs/system.log'
option log_remote '0'
option conloglevel '7'
option cronloglevel '7'
config timeserver 'ntp'
list server '0.openwrt.pool.ntp.org'
list server '1.openwrt.pool.ntp.org'
list server '2.openwrt.pool.ntp.org'
list server '3.openwrt.pool.ntp.org'
config led 'led_wan'
option name 'WAN'
option sysfs 'green:wan'
option trigger 'netdev'
option mode 'link tx rx'
option dev 'eth0'
config led 'led_lan'
option name 'LAN'
option sysfs 'green:lan'
option trigger 'netdev'
option mode 'link tx rx'
option dev 'eth1'
root@OpenWrt:~#