9

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 $
user1032531
  • 307
  • 1
  • 5
  • 10

3 Answers3

11

/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

4

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
Scott Veirs
  • 173
  • 4
1

Here's an explanation on what's going on:

You are running a systemd-based OS where traditional syslog has been replaced with the Journal. The journal stores the same (and more) information as classic syslog. To make use of the journal and access the collected log data simply invoke "journalctl", which will output the logs in the identical text-based format the syslog files in /var/log used to be. For further details, please refer to journalctl(1).

From : /usr/share/doc/systemd/README.logs