LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need Logging Help (https://www.linuxquestions.org/questions/linux-newbie-8/need-logging-help-4175585596/)

wtfamidoing 07-26-2016 09:52 PM

Need Logging Help
 
Hey I'm new here, I just signed up tonight hoping to find the answer to this question...

Based solely off of a process list, how can I find out out whether or not a process is logging? And can I tell where it logging without referencing .conf?

Edit: I should have elaborated... If I were to choose a random or interesting process from the process list, is there a way, using native commands, to interrogate the process to find out if it is being logged, and if so where?

malekmustaq 07-27-2016 12:14 AM

Hi, welcome to LQ!

System process are usually logged at /var/log/syslog; same with the system messages you can query the logs concerning the process if there are some reports --
Code:

sudo cat /var/log/syslog | grep <name of process application>
or you may get the tail 20 lines reports by
sudo tail -20 /var/log/syslog

Other applications keep their log reports in their own log file. You can examine
Code:

ls /var/log
there you will find where common apps place their logs.

If you wish to short sight from the process listing whether the log switch is on or not you may examine if the " -l" switch follows the application list, at least that is a common way of switching although it is not always the case.

Hope that helps.

Good luck and enjoy.

m.m.

jayjwa 07-28-2016 05:49 PM

lsof -p `pidof whatever-program` or lsof -p $PID will show you what that process has open, which usually includes the logfile. You may need root depending on what the process is running under and/or if hidepid is in use on the /proc file system.


All times are GMT -5. The time now is 07:18 AM.