简体   繁体   中英

How to Log error from application which is not running with admin rights

As per the documentation, the program should have admin rights to create source for the event logger.

Can I log the error (Exception) in the event logs if the application is not running with admin rights?

Your setup should create the new source. This means that it requires elevated privileges. It's a normal setup behavior

It may be possible to use a generic existing source? That would solve your problems. But if not.

The best solution I've ever come across it either to need the install program to have a higher (admin) rights and have that to create the source, etc. Then your reduced rights application can create events using the previously created source. Another option if you can't modify the install program is just to have a separate app, again that must run with increased rights that creates the source for your application to run. In both this situation as part of the install/setup process you do need someone with admin rights to do it for you.

Luckily for me in this situation I've never had to do this for a large deployment, but for that situation maybe your infrastructure team could come up with a way of doing this, is there a windows platform way of creating event log source entries. That might be a better answer for serverfault as it's not really a programming question then?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM