Enterprise Logging does nothing on server

  • Thread starter Thread starter Daniel S
  • Start date Start date
D

Daniel S

Hi,

I'm new here.

I'm using the Logging Application Block with Enterprise Library 3.1.
My program works correctly on my XP developer station, but on the 2003
Server, no new entries appear in the Application log after calls to
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(object
message), but those calls aren't throwing exceptions, either.

I tried using System.Diagnostics.EventLog instead. Again, this works
as it should on my XP station, but on the server, it throws an
exception with the message "Showing a modal dialog box or form when
the application is not running in UserInteractive mode is not a valid
operation. Specify the ServiceNotification or DefaultDesktopOnly
style to display a notification from a service application."

I'd really appreciate any help you can offer.

Thanks,
Daniel Sheiner
 
Daniel S said:
Hi,

I'm new here.

I'm using the Logging Application Block with Enterprise Library 3.1.
My program works correctly on my XP developer station, but on the 2003
Server, no new entries appear in the Application log after calls to
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(object
message), but those calls aren't throwing exceptions, either.

I tried using System.Diagnostics.EventLog instead. Again, this works
as it should on my XP station, but on the server, it throws an
exception with the message "Showing a modal dialog box or form when
the application is not running in UserInteractive mode is not a valid
operation. Specify the ServiceNotification or DefaultDesktopOnly
style to display a notification from a service application."

System.Diagnostics.EventLog does not display anything on the screen. Perhaps
it is throwing an exception, and your exception handler is trying to display
something?
 
System.Diagnostics.EventLog does not display anything on the screen. Perhaps
it is throwing an exception, and your exception handler is trying to display
something?

In that case, the question is what kind of exception would
System.Diagnostics.EventLog throw that wouldn't be displayed directly
in my web browser like other exceptions?
 
Hi,

I'm new here.

I'm using the Logging Application Block with Enterprise Library 3.1.
My program works correctly on my XP developer station, but on the 2003
Server, no new entries appear in the Application log after calls to
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(object
message), but those calls aren't throwing exceptions, either.

I tried using System.Diagnostics.EventLog instead.  Again, this works
as it should on my XP station, but on the server, it throws an
exception with the message "Showing a modal dialog box or form when
the application is not running in UserInteractive mode is not a valid
operation.  Specify the ServiceNotification or DefaultDesktopOnly
style to display a notification from a service application."

I'd really appreciate any help you can offer.

Thanks,
Daniel Sheiner

Not sure if this mirrors your situation, but...
When I first used this block, I couldn't write to the event log from a
web service on my development machine. As in your case, no exception
was thrown.

But if I ran the windows sample app that came with the block, I could
write to the event log. Turns out that this worked because the
windows app ran under my id, while the web service ran under the
ASP.NET user id, which didn't have permissions to write events.

But....if once category was already established in the event log, then
the web service write an event with that category. So I used the
windows app to establish the category, and then I was ok.

There may be a simpler way to accomplish this, but try writing the
same event with that sample program, i.e. \EntLib3Src\Quick Starts
\Logging\CS\LoggingQuickStart,
and then see if your web app can do it.
 
Turns out the event source in my web.config didn't match the event
source the program created in the event log's registry. I don't know
why this would throw an exception for System.Diagnostics.EventLog but
NOT for Microsoft.Practices.EnterpriseLibrary.Logging.Logger, but at
least it's working now.

Thanks for the help, guys!!!
 
Daniel S said:
Turns out the event source in my web.config didn't match the event
source the program created in the event log's registry. I don't know
why this would throw an exception for System.Diagnostics.EventLog but
NOT for Microsoft.Practices.EnterpriseLibrary.Logging.Logger, but at
least it's working now.

Make sure you have the category enabled for logging errors. I forget what
it's called, but there is a category for errors that happen in the process
of logging errors.
 
Back
Top