Cannot implement Custom Logging with Example Code from Postsharp

info's Avatar

info

27 Sep, 2018 05:32 PM

To whom it may concern,

I have tried to implement a custom logger like described in the documentation and got an exception in the constructor.

I copied the classes from the github example and even then get the Exception in the cunstructor.

Please advise.

Thanks
  Andreas Kroll

  1. Support Staff 1 Posted by PostSharp Techn... on 30 Sep, 2018 10:54 AM

    PostSharp Technologies's Avatar

    Hello Andreas,

    does the sample itself compile and run correctly for you? I'm not able to see the actual error in the screenshot you have sent. Can you please share the error stack trace and some information about the code you are trying to apply your custom logging to?

    Thanks in advance!

    Best regards,
    Daniel

  2. 2 Posted by info on 01 Oct, 2018 02:45 PM

    info's Avatar

    Sorry, I attached the wrong screenshot.
    Here is the exception:

  3. Support Staff 3 Posted by PostSharp Techn... on 01 Oct, 2018 04:19 PM

    PostSharp Technologies's Avatar

    Hello Andreas,

    thank you for the update. One possible source of this issue is that you might have logging applied to your custom logging infrastructure itself. Have you excluded the LogAttribute from the namespace where you have the types implementing your custom back-end? See lines 8,9,10,11 in https://github.com/postsharp/PostSharp.Samples/blob/master/Diagnost....

    If this doesn't help, could you please provide a complete project reproducing this issue, so we can investigate it?

    Best regards,
    -tony

  4. Support Staff 4 Posted by PostSharp Techn... on 08 Oct, 2018 03:20 PM

    PostSharp Technologies's Avatar

    Hello,

    We are going to close this request as there have not been any further updates. Please feel free to reopen the discussion if you need more help.

    Thanks,
    PostSharp Team

  5. PostSharp Technologies closed this discussion on 08 Oct, 2018 03:20 PM.

  6. info re-opened this discussion on 16 Oct, 2018 12:09 PM

  7. 5 Posted by info on 16 Oct, 2018 12:09 PM

    info's Avatar

    Hi again,

    sorry for taking this long to answer to your suggestion. I was rather busy with feature deployments :-(

    I have now been able to test your suggestion to disable logging within the custom logging classes. This seems to work.

    Now I have a rather awkward behavior that is difficult to track:

    If I let the program run with FULL Logging, I get around 300.000 entries of logging.
    After some time the logging stops and even page Reloads do not produce any logging at all.

    Do you have any idea what this could be?
    Log4net output in itself does still work.

    Regards
      Andreas

  8. Support Staff 6 Posted by PostSharp Techn... on 16 Oct, 2018 12:46 PM

    PostSharp Technologies's Avatar

    Hi Andreas,

    please have a look at this documentation http://doc.postsharp.net/6.0/logging-exception-handling. It describes how to manage errors in logging framework. Let us know if this helped you to figure out the cause, please.

    Best regards,
    -tony

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • 2018-09-27_12-06-58.png 24.8 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac