Как успокоить Ubuntu 15.04 шумный syslog

7

В Ubuntu 15.04 (Vivid Vervet) /var/log/syslog очень шумно. Есть сообщения каждые несколько секунд, из systemd , thermald , gnome-session . Большинство сообщений кажутся несущественными, просто повторяющиеся или повторяющиеся сообщения повторяются снова и снова.

Я считаю, что это очень затрудняет использование syslog для устранения неполадок, отслеживания ошибок и сбоев, поскольку журнал заполнен повторяющимися фрагментами несущественных сообщений о статусе от разных демонов. Есть ли способ настроить систему для отключения таких сообщений в syslog? Спасибо.

Например, следующий фрагмент сообщений thermald повторяется каждые 10-60 секунд в syslog:

May 30 17:37:14 xxx thermald[960]: Dropped below poll threshold
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset index 0:Processor
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset index 4:intel_powerclamp
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset index 6:intel_pstate
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset index 5:rapl_controller
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset index 0:Processor
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset index 4:intel_powerclamp
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset index 6:intel_pstate
May 30 17:37:14 xxx thermald[960]: thd_trip_cdev_state_reset index 5:rapl_controller
May 30 17:37:15 xxx thermald[960]: Read set point 0

Кроме того, каждый раз, когда my-weather-indicator обновляет gnome-session , заполняет syslog следующими 150 строками сообщений о статусе (со временем он заполняет большую часть syslog):

May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075020
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433073280
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 1740
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075080
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433073280
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 1800
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: --- Updating data in location 1 ---
May 31 08:44:41 xxx gnome-session[1848]: ****** Updating weather
May 31 08:44:41 xxx gnome-session[1848]: ****** Calculating rawOffset
May 31 08:44:41 xxx gnome-session[1848]: ********************************************************
May 31 08:44:41 xxx gnome-session[1848]: ********************************************************
May 31 08:44:41 xxx gnome-session[1848]: 05:39 << 8:24 << 20:52
May 31 08:44:41 xxx gnome-session[1848]: ********************************************************
May 31 08:44:41 xxx gnome-session[1848]: ********************************************************
May 31 08:44:41 xxx gnome-session[1848]: -------------------------------------------------------
May 31 08:44:41 xxx gnome-session[1848]: -------------------------------------------------------
May 31 08:44:41 xxx gnome-session[1848]: OpenWeatherMap Weather Service url:http://api.openweathermap.org/data/2.5/weather?lat=43.6619&lon=-79.3952
May 31 08:44:41 xxx gnome-session[1848]: -------------------------------------------------------
May 31 08:44:41 xxx gnome-session[1848]: -------------------------------------------------------
May 31 08:44:41 xxx gnome-session[1848]: ****** Updated weather
May 31 08:44:41 xxx gnome-session[1848]: **** New temperature: 9°
May 31 08:44:41 xxx gnome-session[1848]: --- End of updating data in location 1 ---
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075141
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 60
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075201
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 120
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075261
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 180
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075321
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 240
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075381
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 300
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075441
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 360
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075501
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 420
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075561
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 480
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075621
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 540
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075681
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 600
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075741
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 660
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075801
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 720
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075861
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 780
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075921
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 840
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433075981
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 900
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433076041
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 960
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433076101
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 1020
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433076161
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 1080
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////
May 31 08:44:41 xxx gnome-session[1848]: message repeated 3 times: [ ///////////////////////////////////////////////////////]
May 31 08:44:41 xxx gnome-session[1848]: time.time() = 1433076221
May 31 08:44:41 xxx gnome-session[1848]: self.actualization_time = 1433075081
May 31 08:44:41 xxx gnome-session[1848]: (time.time()-self.actualization_time) = 1140
May 31 08:44:41 xxx gnome-session[1848]: self.refresh*3600 = 1800
May 31 08:44:41 xxx gnome-session[1848]: ///////////////////////////////////////////////////////

Кроме того, gnome-session иногда выплескивает огромные куски предупреждений относительно активности zeitgeist , например 200-300 строк сообщений, похожих на это:

May 31 15:01:21 xxx gnome-session[1848]: ** (zeitgeist-datahub:2657): WARNING **: recent-manager-provider.vala:132: Desktop file for "file:///home/zzz/Documents/file.png" was not found, exec: google-chrome-stable, mime_type: image/png
    
задан Andreas J. 30.05.2015 в 21:36
источник

3 ответа

2

[Другой ответ о loglevel=warn неверен. В термическом режиме поддерживается только loglevel=info и loglevel=debug , поэтому он всегда регистрирует как минимум info и более высокие уровни. Я проверил это, проверив исходный код.]

Чтобы успокоиться, используйте:

/etc/rsyslog.d/99-thermald.conf

if $programname == "thermald" and ($syslogseverity-text == "debug" or $syslogseverity-text == "info" or $syslogseverity-text == "notice") then stop

Затем перезапустите rsyslog:

service rsyslog restart

Это отбросит все сообщения о термальном уровне на уровне notice или ниже, все еще регистрируя их на уровне warning или выше.

Вы можете использовать один и тот же базовый шаблон, чтобы успокоить другие программы по своему вкусу. Отправная точка для документации по этой функции (выражения):

Ссылка

    
ответ дан user450033 12.09.2015 в 00:15
источник
2

Чтобы подавить шум по умолчанию в syslog, вы можете отредактировать файл myweatherindicator.py , расположенный в /opt/extras.ubuntu.com/my-weather-indicator/share/my-weather-indicator/ , и закомментировать все отладочные заявления печати, оставленные автором в коде, как показано ниже ...

#print('///////////////////////////////////////////////////////')
#print('///////////////////////////////////////////////////////')
#print('time.time() = %s'%int(time.time()))
#print('self.actualization_time = %s'%int(self.actualization_time))
#print('(time.time()-self.actualization_time) = %s'%int((time.time()-self.actualization_time)))
#print('self.refresh*3600 = %s'%(int(self.refresh*3600)))
#print('///////////////////////////////////////////////////////')
#print('///////////////////////////////////////////////////////')

ПРИМЕЧАНИЕ. В этом файле есть больше отладочных операторов печати, кроме приведенных выше, поэтому вам нужно прокомментировать их все.

    
ответ дан Arul Selvan 17.08.2015 в 13:08
1

Я предпочитаю записывать тепловые сообщения в отдельный файл, поэтому они не отбрасываются и не загромождают syslog. Поместите следующее в файл с именем /etc/rsyslog.d/10-thermald.conf (как указано выше, он должен иметь имя с именем, начинающимся с числа меньше 50)

if $programname == 'thermald' then /var/log/thermald.log & stop     

ответ дан Peter Bennett 20.01.2016 в 16:44