How Could I erase the logs from a specific source?


for example,

 

under application node

 

i have hundreds logs, that's ok!

 

but have 37 logs source named: "someapplication"

 

how can erase just them instead of node entirely?

 

the code snippet below erase under application node!

i'd avoid that!

 

is possible?

 

thanks!

 

private void clearlog(string logsource, string logname)

{

log.source = logsource;

log.log = logname;

log.clear();

}

 

 

eventlog.deleteeventsource(sourcename)  trick. not specify logname since every event source name must unique accross event logs anyway.

yours,
   alois kraus



.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'