Home > Domino Tips > Administrator > Server > Easily find a string in a Lotus Domino server log
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

SERVER

Easily find a string in a Lotus Domino server log


Felipe Cardoso
08.29.2006
Rating: -3.44- (out of 5)


Lotus Notes, Domino, Workplace and WebSphere tips and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


VIEW MEMBER FEEDACK TO THIS TIP

Finding specific error messages or monitoring for a particular event in your Lotus Domino server log is almost impossible, given the size of most Lotus Domino server log files.

This code is similar to a script that would be used to find strings on a Lotus Domino server log. It works with Lotus Domino 6.5 in two different views -- Miscellaneous and Mail events. The result will be a .TXT file with the results of the search. To accomplish this, simply follow these steps.

  1. Create a form with the following fields:

    • Server: Text, which is for the name of the server. You can use a dialog list with a view from Domino Directory here.

    • String: Text, which will be the string to be searched.

    • View: Text, where we'll use a dialog list with the options: MailRoutingEvents and MiscEvents.

    • Day: Date, only with documents more recent than that date.

  2. In the form, create a button with the following code:
Sub Click(Source As Button)
Dim session As NotesSession
Dim ws As NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim pos As Long
Dim count As Long
Dim SEARCHSTRING As String
Dim SEARCHSERVER As String
Dim SEARCHVIEW As String
Dim lin2 As String
Dim SDAY As NotesDateTime
 
Dim Filename As String
Dim FF As Integer
Dim slView As NotesView
Dim slDoc As NotesDocument
Dim ServerLog As NotesDatabase

Set Session = New NotesSession
ServerName = Session.CurrentDatabase.Server
Set ws = New NotesUIWorkspace
Set uidoc = ws.CurrentDocument

Call uidoc.Refresh

SEARCHSTRING = uidoc.FieldGetText("String")
SEARCHSERVER = uidoc.FieldGetText("Server")
SEARCHVIEW = uidoc.FieldGetText("View")
Set SDAY = New NotesDateTime(uidoc.FieldGetText("Day"))

Count = 0
FileName = uidoc.FieldGetText("Server") 
& " - " & uidoc.FieldGetText("String") 
' Include your translation list here, 
' I didn't need nothing more than this
FileName = Replace(FileName, ":", "_", 3)
FileName = Replace(FileName, "\", "_", 3) 
' Take care with the path bellow
FileName = "C:\Temp" & Filename & ".txt"
 
FF = Freefile()
Open FileName For Output As #FF

Set ServerLog = 
New NotesDatabase(SEARCHSERVER, "log.nsf")
Set slView = ServerLog.GetView(SEARCHVIEW)
Set slDoc = slView.GetFirstDocument

While Not slDoc Is Nothing
If SDAY.DateOnly <= slDoc.Created Then
Forall lin In slDoc.EventList
pos = Instr(lin, SEARCHSTRING)
If pos >0 Then
Print #FF, Lin
Count = Count + 1
End If
End Forall
End If
Set slDoc = slView.GetNextDocument(slDoc)
Wend
Close #FF
 
Messagebox "Found " & Count & " ocurrences of [" 
& SEARCHSTRING & "]"
End Sub

MEMBER FEEDBACK TO THIS TIP

There have been a some edits to this tip, per the tip's author. It should run perfectly in the format it is currently in.
—Matt Gervais, Assistant Site Editor, SearchDomino.com

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Felipe Cardoso. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Lotus Notes Domino Monitoring and Logging
Repair Lotus Domino server 'Cannot write or create file' error
Track and record Lotus Notes user logins to Domino Server
A Domino Domain Monitoring primer
NotesConnect
Top 10 Notes/Domino administration tips of 2006
Domino Domain Monitoring pros and cons
Top 10 Domino administration tips of 2005
New and Notesworthy: July 2005
Find errors in Notes log through mail database
New and Notesworthy: June 2005

Server
Move a Lotus Domino server to a new certifier without a reinstall
Securely connect Lotus Domino servers on different domains
Track and record Lotus Notes user logins to Domino Server
Use SMTP outbound authentication to relay hosts in Lotus Notes Domino 8
Log off idle Lotus Notes users for better Domino Server performance
Copy Lotus Notes databases from the Domino Server console command line
How to perform an in-place upgrade of Lotus Domino server hardware
Daylight Saving Time 2007 -- seven helpful tips for Lotus Notes administrators
FileZilla
How and why to change replica IDs during a Lotus Notes Domino upgrade

Lotus Domino Server 6
A guided tour of the Lotus Notes Domino blogosphere
How to fix the size limitation on Lotus Notes summary text fields
Routing and replication issues with remote Lotus Domino servers
Cracked users' HTTP passwords still a threat on many Lotus Notes R6 and R7 domains
Using Microsoft Outlook with a Lotus Domino server
Top 10 Notes/Domino administration tips of 2006
Putting a stop to incoming spam on Lotus Notes 6.5
Encryption and privacy in Lotus Notes Domino
Can I use PHP to change tables in MySQL DB running off Domino?
Creating Lotus Archive profile in background in R6

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsWebcastsWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts