We are developing a script in perl which when gives the url and the webserver to hit. It hits the url given in the webserver and gives the html content of the page.
For example :
perl scribehtml.pl --server servername --port portnumber --url /home/firstpage/index.php
This returns the entire html code of the page.
Now we are grepping the errors from the html code and write in a text file. Say when we see a text like 'Internal server error' we will put the entire html code into the text file.
There by we are going to have a error.txt where all the errors for different urls will be stored when we execute the script.
Now my Questions are :
How to make the error.txt into some log file say error.log and what are things i need to do to make a proper structure log file.
Is there any tool in which if we specify the log file it will parse the error in it and display the count of occurrence of each error in the log file in the dashboard.
As for us now I m storing the list of around 500 urls in a text file and parsing the it one by one and executing so there by i am getting error for the urls which are failing and I m writing those errors in the text file error.txt
Ideally you can make your own subroutine to store the logs in to the .log file. The default structure for the log file is as following:
[Timestamp]:Error/Warning/Info: String to define the issue
You can format the lines using printf.