Skip to content

fix(Log4Net): Implement new Append method on GoogleStackDriver#15571

Merged
robertvoinescu-work merged 1 commit intogoogleapis:mainfrom
robertvoinescu-work:fix/Log4NetVersion
Apr 15, 2026
Merged

fix(Log4Net): Implement new Append method on GoogleStackDriver#15571
robertvoinescu-work merged 1 commit intogoogleapis:mainfrom
robertvoinescu-work:fix/Log4NetVersion

Conversation

@robertvoinescu-work
Copy link
Copy Markdown
Contributor

Using log4net 3.3.0 should have Append(IEnumerable<LoggingEvent>) implemented otherwise the bulk append method resolves to multiple single log entry appends (breaking some of our tests).

@robertvoinescu-work robertvoinescu-work requested a review from a team as a code owner April 15, 2026 23:37
@robertvoinescu-work robertvoinescu-work merged commit a8b7b3d into googleapis:main Apr 15, 2026
12 checks passed
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the GoogleStackdriverAppender by introducing a new Append overload that accepts IEnumerable and updating the existing array-based Append method to delegate to it. Feedback suggests adding a null check for the loggingEvents parameter in the new method to enhance robustness against null inputs.

Comment on lines +517 to 519
protected override void Append(IEnumerable<LoggingEvent> loggingEvents)
{
if (!_isActivated)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The new Append(IEnumerable<LoggingEvent> loggingEvents) method should ideally include a null check for the loggingEvents parameter before accessing it or checking _isActivated, especially since it is a protected method that could be called by subclasses or directly within the class. Although log4net typically ensures non-null arguments in its pipeline, adding a guard clause improves robustness.

        protected override void Append(IEnumerable<LoggingEvent> loggingEvents)
        {
            if (loggingEvents == null)
            {
                return;
            }
            if (!_isActivated)

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.

2 participants