Solved

How to put errorlog file of current day into one html file?

Posted on 2011-09-26
5
292 Views
Last Modified: 2012-05-12
How to put errorlog file of current day into one html file? So it would be easier for DBA doing daily check. Or do you have any good idea to check errorlog more directly and easily?
Thanks!
0
Comment
Question by:luyan
  • 3
5 Comments
 
LVL 32

Expert Comment

by:bhess1
ID: 36632907
You can always roll over the errorlog each day, and increase the number of error logs to match the number you need to retain (or create an archiving process on the logs after rollover).
0
 
LVL 18

Accepted Solution

by:
x-men earned 500 total points
ID: 36708805
0
 
LVL 18

Expert Comment

by:x-men
ID: 36708812
0
 

Author Comment

by:luyan
ID: 36719820
X-men, seems LogParser is a pretty good tool.

How to write the command line such as  
   LogParser "select date, ... from ..." ...
for getting information from SQL errorlog?

Could you give me one or two examples?
Thanks!
0
 
LVL 18

Expert Comment

by:x-men
ID: 37130875
example:

LogParser.exe "SELECT TO_TIMESTAMP(STRCAT(STRCAT(DATE,' '), TIME), 'yyyy-MM-dd hh:mm:ss') as DateTime, Source, Message FROM 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG*'" -i:TSV -iSeparator:spaces -iHeaderFile:C:\SQLErrorLogHeader.txt -headerRow:OFF -nskiplines:5 -o:DATAGRID
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question