LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Need a Log File for Application (https://www.linuxquestions.org/questions/linux-server-73/need-a-log-file-for-application-4175538922/)

venugosr 04-06-2015 12:23 PM

Need a Log File for Application
 
Hi Team,

We are using an application to send the bulk mails. Need to start/stop the application manually. But we don't have any log files. Could you please advise is it possible to create a log file for any particular application through script? That is who is starting/stoping the application and that one has to capture in that log file. Please check and advise.

Thanks,

Srikanth.V

T3RM1NVT0R 04-06-2015 12:36 PM

Does this application have not got any log file of its own. Instead of creating a script I would suggest that you allow stop / start of this application via sudo. You can then have sudo.log to monitor who is starting / stopping / restarting this application.

Make sure that users are not allowed to restart the application without using sudo.

venugosr 04-07-2015 12:50 PM

Hi,
1. We dont have sudo option for the start/stop the script.
2. It doesn't have any log file of its own.
Sometimes the application will stop automatically or someone stop it. Then we'll get an alert to start the applciation and Client will ask the reason how it got stopped. Without log file we are not able to find the "Root Cause". If the script is running to capture to the logs for that applcation, then it will help us to find the Root Cause easily.

"For Example: In IBM Websphere we have a log file. It will throw all types of Errors. With the help of that we can easily find the Root Cause." Sameway is there any possible way to create a script to find the results. I'm new to Linux. So please help me.

Thanks a lot in advance.

Regdars,

Srikanth.V

T3RM1NVT0R 04-07-2015 01:27 PM

By script you cannot do logging. I mean you can have a script to check if application is running or not. You can have a script to track when the application went down but what you are looking for is detailed log which I don't think is possible via script.

By default application should have the log if it does not have a log then atleast application should have option to send warnings or errors to standard system log.

You have to check with the team who developed this application. Ask them if they have any switch or option to generate the log for the application.

venugosr 04-08-2015 09:57 AM

Hi T3RM1NVT0R,

Thanks for breif explanation. Could you please provide the script which is used to track when the application went down. Might it will helpful for me.

Thanks,

Srikanth.V

TB0ne 04-08-2015 10:48 AM

Quote:

Originally Posted by venugosr (Post 5344424)
Hi T3RM1NVT0R,
Thanks for breif explanation. Could you please provide the script which is used to track when the application went down. Might it will helpful for me.

We aren't going to write your scripts for you...see the "Question Guidelines" link in my posting signature. If you want your application to log errors, then YOU are going to have to modify it to do so. We can't change your code for you. We will be happy to HELP you if you get stuck, so post what you have written/tried, and give us complete details, and we can assist.

Also, you provide no real details..you say "an application", but don't tell us which one. You don't say what version/distro of Linux, what kind of environment, etc. Also, you're probably not going to find a lot of people willing to help someone shovel out bulk emails...no one likes spam.

T3RM1NVT0R 04-08-2015 11:27 AM

Quote:

Hi T3RM1NVT0R,

Thanks for breif explanation. Could you please provide the script which is used to track when the application went down. Might it will helpful for me.

Thanks,

Srikanth.V
There is no script that I have. Basically what I was talking about is a watchdog script which you can create yourself. As TB0ne said we will not write script for you. It is something you have to come up with and if you are stuck somewhere then we are here to assist.

What you should be looking at is a script which can check the exit status of the command used to check the script status. You can configure the script to do that every second and you can add it to crontab to run every minute. This pointer should be good enough to give you an idea on how you have to write it.


All times are GMT -5. The time now is 06:21 AM.