Python Forum
Looking for Linux system logging daemon
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking for Linux system logging daemon
#1
Hello all,
I'd like to ask you for suggestions on system logging to use on a minimalistic Linux. I would like to have a program (best if it's a daemon, with low memory footprint, free/O.S.), that would periodically output logging data (e.g. to a file, every 5 seconds or so). Some of the things I would like the daemon to log is process starts, terminations, some signals, networking events, maybe also CPU and memory usage.
Sorry if my description was blunt, frankly I don't really know what are my options and if I am looking in the right direction at all. Thanks!
Best, JC
Reply
#2
Hello!
Linux has a very powerful logging system. I can't tell you how to use it. I never run a server or needed to monitor other than memory usage. Perhaps you need a good log analyzer. 
Quick googling:
The Linux logging files

The simplest way is to use the Linux tools. For example, you can just pipe ps auxf or ps aux if you don't want tree output formatting to grep or parse the whole output.
There are some good one-liners in StackOverflow dealing with the topic. Here is one.

Also look at atop. It seems it has some logging abilities.

I am using htop but it doesn't write logs.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#3
Apache has a quite extensive log system if your running a server

root /var/log/apache2 # tail -n 5 error.log
[Fri Oct 14 09:35:07.840187 2016] [core:notice] [pid 24970] AH00051: child pid 31051 exit signal Aborted (6), possible coredump in /etc/apache2
Fatal Python error: PyEval_AcquireThread: NULL new thread state
Fatal Python error: PyEval_AcquireThread: NULL new thread state
[Fri Oct 14 09:35:08.842585 2016] [core:notice] [pid 24970] AH00051: child pid 31053 exit signal Aborted (6), possible coredump in /etc/apache2
[Fri Oct 14 09:35:09.843871 2016] [core:notice] [pid 24970] AH00051: child pid 31052 exit signal Aborted (6), possible coredump in /etc/apache2
root /var/log/apache2 # ls ../
alternatives.log       auth.log.3.gz          dpkg.log.2.gz   mail.err.4.gz   syslog
alternatives.log.1     auth.log.4.gz          dpkg.log.3.gz   mail.log        syslog.1
alternatives.log.2.gz  boot.log               faillog         mail.log.1      syslog.2.gz
alternatives.log.3.gz  bootstrap.log          fontconfig.log  mail.log.2.gz   syslog.3.gz
apache2                btmp                   fsck            mail.log.3.gz   syslog.4.gz
apport.log             btmp.1                 installer       mail.log.4.gz   syslog.5.gz
apport.log.1           cloud-init.log         kern.log        msmtp.log       syslog.6.gz
apport.log.2.gz        cloud-init-output.log  kern.log.1      mysql           syslog.7.gz
apport.log.3.gz        dist-upgrade           kern.log.2.gz   mysql.err       udev
apport.log.4.gz        dmesg                  kern.log.3.gz   mysql.log       unattended-upgrades
apport.log.5.gz        dmesg.0                kern.log.4.gz   mysql.log.1.gz  upstart
apport.log.6.gz        dmesg.1.gz             landscape       mysql.log.2.gz  wtmp
apport.log.7.gz        dmesg.2.gz             lastlog         mysql.log.3.gz  wtmp.1
apt                    dmesg.3.gz             mail.err        mysql.log.4.gz
auth.log               dmesg.4.gz             mail.err.1      mysql.log.5.gz
auth.log.1             dpkg.log               mail.err.2.gz   mysql.log.6.gz
auth.log.2.gz          dpkg.log.1             mail.err.3.gz   mysql.log.7.gz

root /var/log/apache2 # tail -n 1 access.log

IP_REMOVED - - [14/Oct/2016:09:44:39 -0400] "GET /attachment.php?thumbnail=41 HTTP/1.1" 200 2457 "http://python-forum.io/Thread-How-to-insert-local-my-computer-image-as-spoiler?page=2" "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG SM-G928F/G928FXXS3BPIB Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/IP_REMOVED Mobile Safari/537.36"
Recommended Tutorials:
Reply
#4
Thank you for answers. I think I will give syslogd a try, once I get it to install on the system :D
Also, is there a simple way to log kernel output messages to a file?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Running Miniconda on a Linux-Box: adding the vscode and Spyder to the whole system apollo 2 3,098 Jul-05-2021, 09:32 PM
Last Post: apollo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020