.NET and EventLog Question

  • Thread starter Thread starter Oleg Medyanik
  • Start date Start date
O

Oleg Medyanik

Hi.
I have a question regarding .NET and EventLog.
Our company has two products, each of them is using own Windows Event Log.
The problem is that Log Name usually starts from Company Name Like:
MyCompany ProductName1
MyCompany ProductName2
and log file name is created using first 8 characters of the log name.
Our company name is larger than 8 characters and thus i can not create 2-nd
log starting from Company Name
Is there any API to overcome this issue?

I see that MS can do this:
Microsoft Office Diagnostics - ODiag.evt
Microsoft Office Sessions - OSession.evt

Thanks
 
Hello Oleg,

What API did u already try? See EventLog class in msnd

AFAIK you can take existed evt file, rename in whatever u like and add manually
to the list of existed logs

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


OM> Hi.
OM> I have a question regarding .NET and EventLog.
OM> Our company has two products, each of them is using own Windows
OM> Event Log.
OM> The problem is that Log Name usually starts from Company Name Like:
OM> MyCompany ProductName1
OM> MyCompany ProductName2
OM> and log file name is created using first 8 characters of the log
OM> name.
OM> Our company name is larger than 8 characters and thus i can not
OM> create 2-nd
OM> log starting from Company Name
OM> Is there any API to overcome this issue?
OM> I see that MS can do this:
OM> Microsoft Office Diagnostics - ODiag.evt
OM> Microsoft Office Sessions - OSession.evt
OM> Thanks
OM>
 
Hi Michael.

thank you for the quick answer

I've looked at Event Logging Comparison Functions

http://msdn2.microsoft.com/en-us/library/aa302340.aspx#win32map_eventloggingfunctions

especially to

OpenEventLog

RegisterEventSource

And have not found the appropriate API to register file name separate from
log display name.



I have not tried yet, but of course I will try some things with the registry
and manual file substitution,

but
http://msdn2.microsoft.com/en-us/library/system.diagnostics.eventlog.log.aspx
says that

Log names are limited to eight characters. According to the system,
MyLogSample1 and MyLogSample2 are the same log.

And I am afraid that I will not succeed.
 
Hello Oleg,

Im not sure that u are able to create the eventlog source more then 8 symbols
with .NET API

U should do it manullay, by renaming existed one, or look into WinAPI methods

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


OM> Hi Michael.
OM>
OM> thank you for the quick answer
OM>
OM> I've looked at Event Logging Comparison Functions
OM>
OM>
OM> http://msdn2.microsoft.com/en-us/library/aa302340.aspx#win32map_even
OM> tloggingfunctions
OM>
OM> especially to
OM>
OM> OpenEventLog
OM>
OM> RegisterEventSource
OM>
OM> And have not found the appropriate API to register file name
OM> separate from log display name.
OM>
OM> I have not tried yet, but of course I will try some things with the
OM> registry and manual file substitution,
OM>
OM> but
OM> http://msdn2.microsoft.com/en-us/library/system.diagnostics.eventlog
OM> .log.aspx says that
OM>
OM> Log names are limited to eight characters. According to the
OM> system, MyLogSample1 and MyLogSample2 are the same log.
OM>
OM> And I am afraid that I will not succeed.
OM>
OM> OM>
Hello Oleg,

What API did u already try? See EventLog class in msnd

AFAIK you can take existed evt file, rename in whatever u like and
add
manually to the list of existed logs
---
WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we
miss it, but that it is too low and we reach it" (c) Michelangelo
OM> Hi.
OM> I have a question regarding .NET and EventLog.
OM> Our company has two products, each of them is using own Windows
OM> Event Log.
OM> The problem is that Log Name usually starts from Company Name
Like:
OM> MyCompany ProductName1
OM> MyCompany ProductName2
OM> and log file name is created using first 8 characters of the log
OM> name.
OM> Our company name is larger than 8 characters and thus i can not
OM> create 2-nd
OM> log starting from Company Name
OM> Is there any API to overcome this issue?
OM> I see that MS can do this:
OM> Microsoft Office Diagnostics - ODiag.evt
OM> Microsoft Office Sessions - OSession.evt
OM> Thanks
OM>
 
Back
Top