?
Solved

Get Size of Event Viewer Log

Posted on 2004-10-13
4
Medium Priority
?
182 Views
Last Modified: 2010-05-02
I'm writing to the event viewere using App.LogEvent. Does anyone know how I can check the size of the application log in the event viewer?

Thanks in advance
0
Comment
Question by:LeeHenry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:AjithJose
ID: 12311077
You can specify the size in the registry under the event log entries. For
instance to change the size of the app log you would change the key

hkey_local_machine\system\currentcontrolsset\services\eventlog\application\MaxSize

Which is a DWORD

you can set it from VB using windows registry API
0
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 1600 total points
ID: 12364961
Have you tried using FileLen?

Private Const MAX_PATH = 260
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Private Sub Command1_Click()
Dim strBuff As String, strSysDir As String
strBuff = Space$(MAX_PATH)

GetSystemDirectory strBuff, MAX_PATH
strSysDir = Left$(strBuff, InStr(strBuff, Chr$(0)) - 1)

MsgBox FileLen(strSysDir & "\Config\AppEvent.evt")

End Sub
0
 
LVL 6

Author Comment

by:LeeHenry
ID: 12374185
Thanks vinnyd!
I can work with this.
Is there a way I can check the maximum file size that was set on the eventviewer?

If not I can use your input, and specify my own file size to make sure it doesn't go over..


Thanks.
0
 
LVL 4

Assisted Solution

by:AjithJose
AjithJose earned 400 total points
ID: 12374495

Check the key: hkey_local_machine\system\currentcontrolsset\services\eventlog\application\MaxSize

Which is a DWORD

you can get it from VB using windows registry API
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

752 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