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.
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.
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.
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.
Hi,
I don't think so - you could just create your own bespoke logging service and inject this into the controller.
Something like:
https://www.infoworld.com/article/2980677/implement-a-simple-logger-in-csharp.html
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.
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.
MySainsburys
is working on a reply...