Confluent-kafka-dotnet: [Feature Request] Replace logger with microsoft logging lib

Created on 29 Apr 2019  路  3Comments  路  Source: confluentinc/confluent-kafka-dotnet

Most helpful comment

the core library is currently compatible with netstandard1.3 and net451 - there is a lot of demand for this, it doesn't make sense to give this up for small convenience in logging in some scenarios. You can use SetLogHandler to implement any log handling code you like (which will override the logging to stderr, which librdkafka does by default). In the future, we may provide an abstraction that uses Microsoft.Extensions.Logging out of the box for use with asp.net, but we haven't done this yet.

All 3 comments

we may provide some higher level abstractions in the future, including for ASP.NET, and we may make use of this there. we definitely won't add it to the core library because we care a lot about maintaining the widest possible compatibility and keeping dependencies to a minimum (this dependency requires .net core).

For the newest version of the interface only netstandard 2.0 is required. https://www.nuget.org/packages/Microsoft.Extensions.Logging.Abstractions/2.2.0

Beside, It would great to be able to replace the Console.WriteLine. For example, to allow user to set a logger in a consumer builder. It could be a small logging interface.

the core library is currently compatible with netstandard1.3 and net451 - there is a lot of demand for this, it doesn't make sense to give this up for small convenience in logging in some scenarios. You can use SetLogHandler to implement any log handling code you like (which will override the logging to stderr, which librdkafka does by default). In the future, we may provide an abstraction that uses Microsoft.Extensions.Logging out of the box for use with asp.net, but we haven't done this yet.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Eibwen picture Eibwen  路  3Comments

snober picture snober  路  3Comments

Ravindranrajendran picture Ravindranrajendran  路  3Comments

SaMirzaei picture SaMirzaei  路  4Comments

keggster101020 picture keggster101020  路  4Comments