List Info

Thread: Re: AW: WMI-Appender question




Re: AW: WMI-Appender question
country flaguser name
United States
2008-02-27 12:02:14
Can you post a non-log4net snippet showing how you're
posting messages to WMI in non-admin mode? If you can do it
outside of log4net, it should be possible to convert the
code to work within log4net. If you can't get it to work
outside of log4net, then you'll need to solve that issue
first.

----- Original Message ----
From: Andreas Brauchli <abagb70.ch>
To: Log4NET Dev <log4net-devlogging.apache.org>
Sent: Thursday, February 21, 2008 2:36:28 AM
Subject: AW: WMI-Appender question

Hi Ron,

The logging doesn't differ from the usual Log4Net style:

if (log.IsInfoEnabled) log.Info("Foo");

the application .config states:
    <appender name="WmiAppender"
             
type="log4net.Appender.WmiAppender,log4net.Appender.Wmi
Appender" >
    </appender>

The DefaultProjectInstaller class is used and the schema
registered in WMI.

I have an application that listens to these events, but
these will only come in when the log4net-app. Is run with
administrative priviledges.

Thanks,
andreas

-----Ursprüngliche Nachricht-----
Von: Ron Grabowski [mailto:rongrabowskiyahoo.com] 
Gesendet: Mittwoch, 20. Februar 2008 02:17
An: Log4NET Dev
Betreff: Re: WMI-Appender question

How do you fire using normal WMI code when the application
is run in non-admin mode?

----- Original Message ----
From: Andreas Brauchli <abagb70.ch>
To: log4net-devlogging.apache.org
Sent: Tuesday, February 19, 2008 3:21:51 AM
Subject: WMI-Appender question

I am experimenting with the WMI Appender and I found it to
be just what
I want. The only issue that needs to be resolved, is how to
fire events
when the application doesn't run as admin. Any solutions?

thanks,
andreas





AW: AW: WMI-Appender question
country flaguser name
Switzerland
2008-02-28 01:37:55
That's the point, i don't know how to do it and this seems
to be the consensus. Currently I'm working on a solution
that provides a static WMI method that will fire the event
for you.. unfortunately the method crashes in strange ways
as soon as I start doing more than a simple return of the
value.. anyway..

Thanks, I'll keep you updated if I find something
andreas


-----Ursprüngliche Nachricht-----
Von: Ron Grabowski [mailto:rongrabowskiyahoo.com] 
Gesendet: Mittwoch, 27. Februar 2008 19:02
An: Log4NET Dev
Betreff: Re: AW: WMI-Appender question

Can you post a non-log4net snippet showing how you're
posting messages to WMI in non-admin mode? If you can do it
outside of log4net, it should be possible to convert the
code to work within log4net. If you can't get it to work
outside of log4net, then you'll need to solve that issue
first.

----- Original Message ----
From: Andreas Brauchli <abagb70.ch>
To: Log4NET Dev <log4net-devlogging.apache.org>
Sent: Thursday, February 21, 2008 2:36:28 AM
Subject: AW: WMI-Appender question

Hi Ron,

The logging doesn't differ from the usual Log4Net style:

if (log.IsInfoEnabled) log.Info("Foo");

the application .config states:
    <appender name="WmiAppender"
             
type="log4net.Appender.WmiAppender,log4net.Appender.Wmi
Appender" >
    </appender>

The DefaultProjectInstaller class is used and the schema
registered in WMI.

I have an application that listens to these events, but
these will only come in when the log4net-app. Is run with
administrative priviledges.

Thanks,
andreas

-----Ursprüngliche Nachricht-----
Von: Ron Grabowski [mailto:rongrabowskiyahoo.com] 
Gesendet: Mittwoch, 20. Februar 2008 02:17
An: Log4NET Dev
Betreff: Re: WMI-Appender question

How do you fire using normal WMI code when the application
is run in non-admin mode?

----- Original Message ----
From: Andreas Brauchli <abagb70.ch>
To: log4net-devlogging.apache.org
Sent: Tuesday, February 19, 2008 3:21:51 AM
Subject: WMI-Appender question

I am experimenting with the WMI Appender and I found it to
be just what
I want. The only issue that needs to be resolved, is how to
fire events
when the application doesn't run as admin. Any solutions?

thanks,
andreas





AW: AW: WMI-Appender question
country flaguser name
Switzerland
2008-02-29 01:48:56
Status update on fireing wmi events without administrative
priviledges:

I made it work.. somehow and _very_ hackish: since one
cannot set permissions for fireing events (wmimgmt.msc) but
one can set permissions to call a method, I decided to
implement a trigger-event method on a wmi provider. The
method worked fine for most tasks except when trying to fire
events. Either it claimed that some
System.Diagnostic(?).install dll couldn't be found or I got
strange exceptions.. there was no way to get it working (I
also tried with reflections..) - in the end I wrote a second
app that triggers the event from args passed, since I can
start apps fine from the method. Now as WMI runs as admin,
the app gets administrative priviledges and the events are
triggered.
As I mentioned the method is very hackish and above all
slow.
Another approach might be to directly call the COM that
fires events (probably with unmanaged code). If someone
manages to get this done I'd gladly replace my method..

What remains to do is modify the log4net wmi appender to
call the wmi method.
Also my provider is decoupled, so the method can't be called
if the provider isn't running. I think this could be
resolved by writing a coupled provider (that runs inside
WMI).

Cheers,
andreas

-----Ursprüngliche Nachricht-----
Von: Andreas Brauchli [mailto:abagb70.ch] 
Gesendet: Donnerstag, 28. Februar 2008 08:38
An: Log4NET Dev
Betreff: AW: AW: WMI-Appender question

That's the point, i don't know how to do it and this seems
to be the consensus. Currently I'm working on a solution
that provides a static WMI method that will fire the event
for you.. unfortunately the method crashes in strange ways
as soon as I start doing more than a simple return of the
value.. anyway..

Thanks, I'll keep you updated if I find something
andreas


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )