Enterprise Logging does nothing on server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel S

    #1

    Enterprise Logging does nothing on server

    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.Pract ices.Enterprise Library.Logging .Logger.Write(o bject
    message), but those calls aren't throwing exceptions, either.

    I tried using System.Diagnost ics.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 ServiceNotifica tion or DefaultDesktopO nly
    style to display a notification from a service application."

    I'd really appreciate any help you can offer.

    Thanks,
    Daniel Sheiner
  • John Saunders

    #2
    Re: Enterprise Logging does nothing on server

    "Daniel S" <daniel.s1@gmai l.comwrote in message
    news:572a5f9e-813c-46a8-8c45-b97889e1c38c@m3 2g2000hsf.googl egroups.com...
    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.Pract ices.Enterprise Library.Logging .Logger.Write(o bject
    message), but those calls aren't throwing exceptions, either.
    >
    I tried using System.Diagnost ics.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 ServiceNotifica tion or DefaultDesktopO nly
    style to display a notification from a service application."
    System.Diagnost ics.EventLog does not display anything on the screen. Perhaps
    it is throwing an exception, and your exception handler is trying to display
    something?

    --
    John Saunders | MVP - Connected System Developer

    Comment

    • Daniel S

      #3
      Re: Enterprise Logging does nothing on server

      System.Diagnost ics.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.Diagnost ics.EventLog throw that wouldn't be displayed directly
      in my web browser like other exceptions?

      Comment

      • cowznofsky

        #4
        Re: Enterprise Logging does nothing on server

        On Oct 15, 2:40 pm, Daniel S <daniel...@gmai l.comwrote:
        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.Pract ices.Enterprise Library.Logging .Logger.Write(o bject
        message), but those calls aren't throwing exceptions, either.
        >
        I tried using System.Diagnost ics.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 ServiceNotifica tion or DefaultDesktopO nly
        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\Qui ck Starts
        \Logging\CS\Log gingQuickStart,
        and then see if your web app can do it.

        Comment

        • Daniel S

          #5
          Re: Enterprise Logging does nothing on server

          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.Diagnost ics.EventLog but
          NOT for Microsoft.Pract ices.Enterprise Library.Logging .Logger, but at
          least it's working now.

          Thanks for the help, guys!!!

          Comment

          • John Saunders

            #6
            Re: Enterprise Logging does nothing on server

            "Daniel S" <daniel.s1@gmai l.comwrote in message
            news:c79bcc1e-960d-4a1e-95d3-4e22fc78dc52@k3 0g2000hse.googl egroups.com...
            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.Diagnost ics.EventLog but
            NOT for Microsoft.Pract ices.Enterprise Library.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.

            --
            John Saunders | MVP - Connected System Developer

            Comment

            Working...