6

I have an out of the box Pi. See below on what I have done. If I have <?php syslog(LOG_INFO,'where are you'); ?> in a PHP script, where the the message being logged?

$ sudo apt-get install nginx
$ sudo mkdir /var/www
$ sudo apt-get install php5-fpm php-apc php5-cli
$ sudo vi /etc/nginx/sites-available/default

EDIT. Extra stuff

pi@raspberrypi /etc $ ls -lrt /var/log
total 2208
drwxr-xr-x 2 root root   4096 Jan  1  1970 apt
drwxr-xr-x 2 root root   4096 Jan  1  1970 fsck
drwxr-x--- 2 root adm    4096 Feb 19  2015 samba
drwxr-xr-x 2 ntp  ntp    4096 Apr 12 22:38 ntpstats
-rw-rw---- 1 root utmp      0 May  6 22:12 btmp
-rw-r--r-- 1 root root 328694 May  6 22:19 bootstrap.log
-rw-r--r-- 1 root root  24024 May  6 23:02 faillog
-rw-r--r-- 1 root root   1746 May  6 23:15 fontconfig.log
-rw-r----- 1 root adm       0 May  6 23:29 mail.warn
-rw-r----- 1 root adm       0 May  6 23:29 mail.log
-rw-r----- 1 root adm       0 May  6 23:29 mail.info
-rw-r----- 1 root adm       0 May  6 23:29 mail.err
-rw-r----- 1 root adm       0 May  6 23:29 lpr.log
drwxr-xr-x 2 root root   4096 May  6 23:29 news
-rw-r--r-- 1 root root    203 May  6 23:29 regen_ssh_keys.log
-rw-r----- 1 root adm    6214 May  6 23:42 dmesg.4.gz
drwx--x--x 2 root root   4096 May  6 23:42 lightdm
drwxr-xr-x 2 root root   4096 May  6 23:42 ConsoleKit
-rw-r----- 1 root adm    6347 Oct  9 02:54 dmesg.3.gz
-rw-r----- 1 root adm    6414 Oct  9 02:57 dmesg.2.gz
-rw-r----- 1 root adm    6332 Oct  9 02:59 dmesg.1.gz
-rw-r----- 1 root adm   16713 Oct  9 03:04 dmesg.0
-rw-r--r-- 1 root root  16233 Oct  9 03:45 Xorg.0.log.old
-rw-r----- 1 root adm   16427 Oct  9 03:45 dmesg
-rw-r----- 1 root adm    8904 Oct  9 03:45 debug
drwxr-xr-x 2 root root   4096 Oct  9 13:32 nginx
-rw------- 1 root root    212 Oct  9 13:41 php5-fpm.log
-rw-r----- 1 root adm  185269 Oct  9 17:04 kern.log
-rw-r--r-- 1 root root  16634 Oct  9 17:13 Xorg.0.log
-rw-rw-r-- 1 root utmp 100992 Oct  9 21:58 wtmp
-rw-rw-r-- 1 root utmp 292292 Oct  9 21:58 lastlog
-rw-r--r-- 1 root root 567771 Oct  9 22:05 dpkg.log
-rw-r--r-- 1 root root  45672 Oct  9 22:05 alternatives.log
-rw-r----- 1 root adm     493 Oct  9 22:11 user.log
-rw-r----- 1 root adm  178412 Oct  9 22:11 messages
-rw-r----- 1 root adm   48791 Oct  9 22:40 daemon.log
-rw-r----- 1 root adm  243859 Oct  9 23:01 syslog
-rw-r----- 1 root adm   37086 Oct  9 23:01 auth.log
pi@raspberrypi /etc $ cat /etc/syslog.conf
cat: /etc/syslog.conf: No such file or directory
pi@raspberrypi /etc $
9

/var/log/messages or maybe nowhere.

Two things to try

$ ls -lrt /var/log # find the most recently written logfile

$ cat /etc/syslog.conf # view the syslog configuration

3
  • Thanks unixbigot, Don't seem to have a syslog.conf See my edited OP. Any other locations? Oct 9 '15 at 23:09
  • 1
    Ah, /var/log/syslog!!!! Oct 9 '15 at 23:12
  • You're welcome. A good trick when you don't know which log is being written is $ sudo tail -f /var/log/* Oct 10 '15 at 4:46
3

On a RPi3 in early 2018 with Raspian I'm seeing system log entries at /var/log/syslog

as user1032531 suggested. Here's a handy way to look through the recent (latest 500 lines of the) syslog:

sudo tail -f /var/log/syslog -n 5000 | more
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.