# Syslog logging broken

**URL:** <https://help.nextcloud.com/t/syslog-logging-broken/31142>\
**Category:** ℹ️ Support\
**Created:** [May 1, 2018, 12:55pm UTC](https://help.nextcloud.com/t/syslog-logging-broken/31142 "2018-05-01T12:55:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon87376550](https://help.nextcloud.com/letter_avatar/anon87376550/32/6_22734026db12803ebb3e059622ac3534.png) [@anon87376550](https://help.nextcloud.com/u/anon87376550)\
**Post date:** [May 1, 2018, 12:55pm UTC](https://help.nextcloud.com/t/syslog-logging-broken/31142/1 "2018-05-01T12:55:50Z")

</div>

My Nextcloud instance loggs to syslog and everything worked fine. I upgraded my server from Debian Wheezy to Jessie now (upgrade to Stretch will be the next step …). After the upgrade my logfile remains empty.

Debian 8.0/Raspbian GNU/Linux 8  
Apache/2.4.10 (Raspbian)  
PHP 5.6.33-0+deb8u1

status.php:  
{“installed”:true,“maintenance”:false,“needsDbUpgrade”:false,“version”:“13.0.1.1”,“versionstring”:“13.0.1”,“edition”:"",“productname”:“Nextcloud”}

config.php:

```auto
<?php
$CONFIG = array (
  'instanceid' => 'myinstance',
  'passwordsalt' => 'mysalt',
  'datadirectory' => '/media/ssd/owncloud',
  'dbtype' => 'mysql',
  'version' => '13.0.1.1',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_owncloud',
  'dbpassword' => 'mydbpassword',
  'installed' => true,
  'ldapIgnoreNamingRules' => false,
  'maintenance' => false,
  'loglevel' => 2,
  'logdateformat' => 'F d, Y H:i:s',
  'logtimezone' => 'Europe/Berlin',
  'log_type' => 'syslog',
  'syslog_tag' => 'ownCloud',
  'mail_smtpmode' => 'php',
  'mail_smtphost' => 'localhost',
  'mail_smtpdebug' => true,
  'log_authfailip' => true,
  'trashbin_retention_obligation' => '1,7',
  'versions_retention_obligation' => '1,7',
  'check_for_working_webdav' => true,
  'check_for_working_htaccess' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'trusted_domains' => 
  array (
    0 => 'mytrusteddomain1',
    1 => 'mytrusteddomain2',
    2 => 'mytrusteddomain3',
    3 => 'mytrusteddomain4',
    4 => 'mytrusteddomain5',
  ),
  'secret' => 'mysecret',
  'overwrite.cli.url' => '/nextcloud',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'nextcloud.mydomain.de',
  'enable_previews' => true,
  'updater.release.channel' => 'stable',
  'updatechecker' => true,
  'updater.server.url' => 'https://updates.nextcloud.com/updater_server/',
);

```

Remark: Naming of database name, user, prefix is historical …

I am logging via syslog-ng.

```auto
filter f_owncloud {
	program("^ownCloud$");
};
destination d_owncloud {
        file("/var/log/owncloud/owncloud.log");
 };
log {
       source(s_src);
       filter(f_owncloud);
       destination(d_owncloud);
       flags(final);
 };

```

Even if I remove filter(f\_owncloud) I cannot find any logfile with Nextcloud entries. Any hints for me?

Thank you!

Best regards,

Franz

---

<div class="post-metadata">

**Author:** ![anon87376550](https://help.nextcloud.com/letter_avatar/anon87376550/32/6_22734026db12803ebb3e059622ac3534.png) [@anon87376550](https://help.nextcloud.com/u/anon87376550)\
**Post date:** [May 1, 2018, 8:52pm UTC](https://help.nextcloud.com/t/syslog-logging-broken/31142/2 "2018-05-01T20:52:36Z")

</div>

It cost me hours to find it. But finally, I solved the problem. It was not Nextcloud, but syslog-ng and the change to systemd.  
I don’t understand it completely, but systemd sends logs to a different stream. So I had to modifiy the syslog-ng.service file:

```auto
nano /lib/systemd/system/syslog-ng.service
#Sockets=syslog.socket
Sockets=syslog.dgram

```

In /etc/syslog-ng/syslog-ng.conf add:

```auto
source s_dgram {
 unix-dgram("/dev/log");
};

```

Create a new file:

```auto
nano /etc/syslog-ng/conf.d/nextcloud.conf
filter f_nextcloud {
        program("^ownCloud$"); # regex has to match the syslog_tag in config.php
};
destination d_nextcloud {
        file("/var/log/nextcloud/nextcloud.log"); # don't forget to configure logrotate for this file
 };
log {
       source(s_dgram);
       filter(f_nextcloud);
       destination(d_nextcloud);
       flags(final);
 };

```

Reload modified service file and restart service:

```auto
systemctl daemon-reload
systemctl restart syslog-ng
systemctl status syslog-ng

```

---

<div class="post-metadata">

**Author:** ![anon87376550](https://help.nextcloud.com/letter_avatar/anon87376550/32/6_22734026db12803ebb3e059622ac3534.png) [@anon87376550](https://help.nextcloud.com/u/anon87376550)\
**Post date:** [May 2, 2018, 6:11pm UTC](https://help.nextcloud.com/t/syslog-logging-broken/31142/3 "2018-05-02T18:11:49Z")

</div>

Once again. My solution is not a good one ☹ Some system logs (auth.log for example) did not work any more. I decided to start syslog-ng with default service file via sysvinit, not via systemd:

sudo mv /lib/systemd/system/syslog-ng.service /lib/systemd/system/syslog-ng.service.bak  
sudo systemctl daemon-reload  
sudo /etc/init.d/syslog-ng start

In my owncloud.cfg I configured source(s\_src), in syslog-ng.conf I deleted source(s\_dgram).

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 7:00am UTC](https://help.nextcloud.com/t/syslog-logging-broken/31142/4 "2024-12-04T07:00:11Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 2:40pm UTC](https://help.nextcloud.com/t/syslog-logging-broken/31142/5 "2024-12-09T14:40:47Z")

</div>


