Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove omexlogger #713

Merged
merged 16 commits into from
Jan 29, 2025
Merged

Remove omexlogger #713

merged 16 commits into from
Jan 29, 2025

Conversation

Gnol-VN
Copy link
Member

@Gnol-VN Gnol-VN commented Jan 22, 2025

This PR is to:

  1. Remove OmexLogger and its relatives
  2. Add an action to support InitializationLogger, so consumers can supply their own logger to know if the host is built successfully or not
  3. Remove [Obsolete] attributes

Why did I add an action to configure the under-the-hood InitializationLogger?

The BuildState(less/ful)Service() will call BuildServiceFabricService(), and this is the only place we do logging just before host is really built.

To receive Initialization logs, the last guard is having InitializationLogger in consumer's Program.cs. However, this has to ensure all consumers use

try { } catch { OTELInitLogger.log(exception) }

I idealize, instead of assuming consumer having this try catch pattern in all of their Program.cs files, this action should be configured in a Shared library, or Shared SDK. For handy experience, consumers within an organisation just need to import the shared library and they do not need to do the try/catch above to get logs from InitializationLogger

Long Do Thanh and others added 7 commits May 10, 2024 11:34
# Conflicts:
#	src/Hosting.Services/HostBuilderExtensions.cs
#	src/Hosting/Certificates/InitializationCertificateReader.cs
#	src/Logging/InitializationLogger.cs
#	src/Logging/Internal/OmexLoggerProvider.cs
#	src/Logging/ServiceCollectionExtensions.cs
#	tests/Logging.UnitTests/OmexLogEventSenderTests.cs
#	tests/Logging.UnitTests/OmexLoggerProviderTests.cs
#	tests/Logging.UnitTests/Scrubbing/ServiceCollectionExtensionsTests.cs
#	tests/Logging.UnitTests/ServiceCollectionTests.cs
@Gnol-VN Gnol-VN marked this pull request as ready for review January 24, 2025 12:32
@Gnol-VN Gnol-VN requested a review from a team as a code owner January 24, 2025 12:32
Copy link
Contributor

@artempushkin artempushkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking to get time for proper review.

Gnol-VN and others added 2 commits January 24, 2025 13:39
Co-authored-by: Keith Cully <2370032+K-Cully@users.noreply.github.com>
@artempushkin
Copy link
Contributor

Did you forget to actually remove OmexLogger?

@Gnol-VN
Copy link
Member Author

Gnol-VN commented Jan 24, 2025

Did you forget to actually remove OmexLogger?

Lol, Absolutely right haha

src/Logging/ServiceCollectionExtensions.cs Outdated Show resolved Hide resolved
src/Logging/OmexLoggingOptions.cs Show resolved Hide resolved
src/Logging/Internal/OmexLoggerProvider.cs Show resolved Hide resolved
src/Abstractions/ServiceContext/IServiceContext.cs Outdated Show resolved Hide resolved
src/Logging/InitializationLogger.cs Outdated Show resolved Hide resolved
src/Logging/InitializationLogger.cs Outdated Show resolved Hide resolved
@Gnol-VN Gnol-VN requested a review from artempushkin January 28, 2025 13:38
@Gnol-VN Gnol-VN enabled auto-merge (squash) January 28, 2025 13:39
@Gnol-VN Gnol-VN requested a review from artempushkin January 29, 2025 10:23
@Gnol-VN Gnol-VN requested a review from artempushkin January 29, 2025 15:39
@Gnol-VN Gnol-VN merged commit a2d5b36 into main Jan 29, 2025
5 checks passed
@Gnol-VN Gnol-VN deleted the dothanhl/feature/remove-omexlogger branch January 29, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants