Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • suzyb 463 posts 874 karma points
    Jan 14, 2021 @ 13:17

    Write certain messages custom user log

    I'd like to log messages from a certain controller to a separate file so to not clutter the Umbraco log with information messages.

    The documentation mentions you can write to a custom log file, but can you do this selectively i.e. have umbraco write to it's usual log but a controller write to a different file.

  • Steve Morgan 1274 posts 4191 karma points c-trib
    Jan 14, 2021 @ 14:54
    Steve Morgan


    I don't think so - you could just create your own bespoke logging service and inject this into the controller.

    Something like:

  • suzyb 463 posts 874 karma points
    Jan 15, 2021 @ 09:42

    OK thanks.

    Might just log them to the Umbraco log if there isn't a built in way to do it. It's just for a one off import so having to create a class is probably more trouble that it's worth.

  • Powell 1 post 71 karma points
    Jan 19, 2021 @ 06:01

    Default file output is in the user's home directory. java.util.logging.FileHandler.pattern You can also prevent a Logger from logging messages below a certain level. In this Multiple Appenders can be combined to write log events to multiple destinations. Custom Layouts let you specify how Appenders output log entries.


Please Sign in or register to post replies

Write your reply to: