Laravel log file size rapidly increasing

It looks like this started early this morning (13 Feb 2019) when daily.sh ran, the size of /opt/librenms/storage/logs/laravel.log has increased nearly 20GB. It is filling up with information every time a device is polled. Some of the data going into the log is here: https://p.libren.ms/view/2143be7c

Output of validate.php is here: https://p.libren.ms/view/a74f52b1

Any help is appreciated. I’m not sure what would be causing this to all of a sudden start.

I’m not sure what is wrong. Last night the size of laravel.log increased so much it filled the root partition and LibreNMS couldn’t poll. According to the output of validate.php, everything is okay. I don’t have any unmodified files in my installation. I went back to the install docs and made sure every required package was installed. There were some missing and it installed them. My next step is going to be a “band-aid” of a cronjob to truncate the log file every hour until I can find the time to build a new server from scratch and migrate data over and see if the problem follows.

Hopefully I’m not hijacking this thread, I believe I’m having the same issue. It also started after daily.sh ran on Feb 13. This is the error in laravel.log, followed by a stacktrace, which I believe to be the cause or related

laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {“exception”:"[object] (InvalidArgumentException(code: 0): Log [logfile] is not defined. at /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:168)

Any help/direction would be greatly appreciated.

====================================

Component Version
LibreNMS   1.48.1-50-g0b802d657
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP        7.2.15-0ubuntu0.18.04.1
MySQL      5.7.25-0ubuntu0.18.04.2
RRDTool    1.7.0
SNMP       NET-SNMP 5.7.3
====================================`

That looks exactly the same as mine. Here is from a few minutes ago, same error as you, the “emergency” one and the stacktrace which follows. The error occurs when a poller is running.

[2019-02-14 11:02:10] laravel.EMERGENCY: Unable to create configured logger. Using     emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [logfile] is not defined. at /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:168)
[stacktrace]
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(102): Illuminate\\Log\\LogManager->resolve('logfile')
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(90): Illuminate\\Log\\LogManager->get('logfile')
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(555): Illuminate\\Log\\LogManager->driver()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(237): Illuminate\\Log\\LogManager->debug('/opt/librenms/p...')
#4 /opt/librenms/includes/helpers.php(39): Illuminate\\Support\\Facades\\Facade::__callStatic('debug', Array)
#5 /opt/librenms/poller.php(187): d_echo('/opt/librenms/p...')
#6 {main}
"}
[2019-02-14 11:02:10] laravel.DEBUG: /opt/librenms/poller.php 17 2019-02-14 11:02:10 - 1 devices polled in 2.114 secs


====================================
Component | Version
--------- | -------
LibreNMS  | 1.48.1-52-g63de34e
DB Schema | 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP       | 7.2.14
MySQL     | 5.5.60-MariaDB
RRDTool   | 1.4.8
SNMP      | NET-SNMP 5.7.2
====================================

[OK]    Composer Version: 1.8.4
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct

Fix was placed into the master… Run updates or wait for the cron to run.

I’m still experiencing the problem, even after running updates. The laravel.log file still is increasing in size and the logs are the same as before. Thanks for the help. Let me know if further outputs or info is needed. I’m not having much luck figuring this issue out.

daily.sh output:

-bash-4.2$ ./daily.sh
Updating to latest codebase                        OK
Updating Composer packages                         OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK

validate.php output:

bash-4.2$ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.48.1-52-g63de34e
DB Schema | 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP       | 7.2.14
MySQL     | 5.5.60-MariaDB
RRDTool   | 1.4.8
SNMP      | NET-SNMP 5.7.2
====================================

[OK]    Composer Version: 1.8.4
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct

laravel.log still increasing rapidly:

-rw-rw-r-- 1 librenms librenms 747459248 Feb 14 13:16 laravel.log
-bash-4.2$ ls -l storage/logs
total 1750016
-rw-rw-r-- 1 librenms librenms 747635368 Feb 14 13:16 laravel.log

errors in laravel.log:

-bash-4.2$ tail -n 100 storage/logs/laravel.log
[2019-02-14 13:16:19] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [logfile] is not defined. at /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:168)
[stacktrace]
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(102): Illuminate\\Log\\LogManager->resolve('logfile')
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(90): Illuminate\\Log\\LogManager->get('logfile')
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(555): Illuminate\\Log\\LogManager->driver()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(237): Illuminate\\Log\\LogManager->debug('ifOutBroadcastP...')
#4 /opt/librenms/includes/helpers.php(39): Illuminate\\Support\\Facades\\Facade::__callStatic('debug', Array)
#5 /opt/librenms/includes/polling/ports.inc.php(579): d_echo('ifOutBroadcastP...')
#6 /opt/librenms/includes/polling/functions.inc.php(303): include('/opt/librenms/i...')
#7 /opt/librenms/poller.php(157): poll_device(Array, false)
#8 {main}
"}

Can you create a file in your LibreNMS directory and run it?

<?php

$init_modules = ['laravel'];
require __DIR__ . '/includes/init.php';

var_dump(config('logging'));

Then paste the output here.

Hi,

I’m also having this issue, I ran ./daily this morning and was hoping for the issue to be fixed but the laravel.log keeps on increasing, I ran the script you provided

/opt/librenms$ sudo -u librenms php test.php
NULL

Created the file and ran it here is the output:

[me@librenms ~]$ cd /opt/librenms
[me@librenms  librenms]$ pwd
/opt/librenms
[me@librenms  librenms]$ sudo -u librenms php test.php
NULL

what is the contents of the config/logging.php file?

Contents of config/logging.php: https://p.libren.ms/view/b98baeb6

I’m having this same issue with my laravel.log file growing every time the poller runs with debug output saying the ‘logfile’ is not defined.

I also get ‘NULL’ for the output of that var_dump test.php @murrant posted.

I copied the pastebin and compared it to my config/logging.php and after changing the ‘&lt;’ to ‘<’ on the first line, the md5 checksums of the files are exactly the same (8748aef3f7f390628c2340c1c5c9fd23) as @bwilli’s .

Run php artisan config:clear and delete laravel.log and all log files that have dates in them like librenms-1-1-2019.log

Thanks @murrant! I did that, and have been through at least two polling periods and haven’t seen that laravel.log file reappear since then.

Thanks the same for me, same problem, same new situation => solved for me