Repository navigation
Description
What would you like clarification on
While there is at the moment duplicated Logging setup in our Uno apps, lets say we would just "clean" this ourselfs and just left over the UseSerilog(consoleLoggingEnabled: true, fileLoggingEnabled: true) we are getting preset from the templetes.
- the 3rd optional Argument for configuring Serilog in our hostbuilder for getting just the same as in the non-file logging Microsoft+Uno Generic Loggers with
context.HostingEnvironment.IsDevelopment() ? LogLevel.Information : LogLevel.Warningis not having an HostContext Parameter overload to get the HostingEnvironment like that. How are we meant to implement aMinimumLevel.ControlledBy(...just like that in our uno apps using Serilog? - How are we meant to have the Context specific logger in the DI ctor injected? With Microsoft.Extensions.Logging usage Uno allowes us to use
ILogger<T>and in the Backing FieldILoggerbut that doesnt work when using the Uno FeatureLoggingSerilogwithout the BasicLoggingand giving an compiler error ofCS0308: The non-generic type 'ILogger' cannot be used with type arguments
Concern?
- Usage in industry
- Clarification of capabilities
- Getting started with Uno -> little to none Uno.Extensions.Serilog Docs existing!
- Developing with Uno
- Contributing to the Uno project
- Publishing your application -> not possible to use this UnoFeature to have Logs in Production!
- Support
- Other (please specify):
For which Platform
- iOS
- macOS (AppKit)
- Mac Catalyst
- Android
- WebAssembly
- Windows
- Skia Desktop
- Build tasks
Anything else we need to know?
tryed to use exactly that in a business application last week and even tryed with the regular ms hostbuilder+ uno feature (!) since there seem to be no "Platform" available if you want to use the UnoFeatures in a Console Application, but never got file logs or that linting going away. My only chance was using Log.Error for example, but even then there were no Logs ever created!
To check if thats only caused through the Console app type maybe, I tryed using Serilog in my Desktop targeting App and attached Library Project, but there is no chance to get a generic typed ILogger without code changes implemented in Library Projects at all. so the result would be, you would need anybody who might use your Library as Dependency in the future, to must use Seriog OR you will not be able to use it in your library(?) and by this not having the option of using File logs.
My current workaround is to have a non-generic DI parameter of ILogger and then before putting it into the backing field is logger.ForContext<MyService>() but there seems to be no pre existing way to do this using the uno extension for serilog
Thats why I would like some clarification about how we might be meant to use that in our apps and realistically also in our Production apps, which I would be targeting to do at the end of the road.
Activity