Skip to content

Support source class & method in to-jul (LOG4J2-3282)#698

Merged
carterkozak merged 6 commits intoapache:release-2.xfrom
vorburger:release-2.x_to-jul_source
Jan 14, 2022
Merged

Support source class & method in to-jul (LOG4J2-3282)#698
carterkozak merged 6 commits intoapache:release-2.xfrom
vorburger:release-2.x_to-jul_source

Conversation

@vorburger
Copy link
Member

@vorburger vorburger commented Jan 14, 2022

This is a LOG4J2-3282 related follow-up to #653.

@carterkozak is this what you meant in our conversation here? 😸 (Sorry at the time I didn't get it.)

@carterkozak
Copy link
Contributor

@carterkozak is this what you meant in our conversation here?

Yessir! Looks great :-) I probably could have described it more clearly.

Just needs a license header to appease rat.
We might consider naming the record type something more descriptive like Log4jLogRecord, but I defer to your judgement.

@vorburger
Copy link
Member Author

Just needs a license header to appease rat.

Duh! I should know better; done!

We might consider naming the record type something more descriptive like Log4jLogRecord

Done, now LazyLog4jLogRecord as that's really what this is (IMHO).

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

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

Please see my comments/questions. TY!

@vorburger
Copy link
Member Author

Please see my comments/questions. TY!

Done!

return super.getSourceMethodName();
}

private synchronized void inferCaller() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think synchronized is necessary based on how this class is used and the thread-safety of the parent class. Synchronization here doesn't buy us anything because it only guards the method itself, not the inferCaller check elsewhere (which isn't volatile, nor do I think it should be) so it would only prevent additional concurrent calls from running in parallel.

Copy link
Member Author

Choose a reason for hiding this comment

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

@garydgregory @carterkozak can I let you guys hash this out among ourselves and let me know your conclusion? I'm happy if you are (both) happy, but I'd prefer not going back and forth a few times between you... 😸 I believe this comment appears to request to (re-)remove synchronized (again, after @garydgregory suggested it be added), and also for volatile to be removed from inferCaller. Please both ACK?

Copy link
Member Author

Choose a reason for hiding this comment

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

s/ourselves/yourselves/

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove the synchronized keyword please, sorry for the churn!

and also for volatile to be removed from inferCaller

I don't think inferCaller is volatile, no change needed there!

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, synchronized removed again now.

I don't think inferCaller is volatile, no change needed there!

Duh, on TGIF the transient morphed into a volatile in my mind 😈

@garydgregory
Copy link
Member

I approved the PR but as my comments are resolved. I'll let @carterkozak give the final nod.😉
TY @vorburger

@carterkozak
Copy link
Contributor

Thanks, Gary :-)

Copy link
Contributor

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! I'll get it merged once I have a moment :-)

@carterkozak carterkozak merged commit edcc220 into apache:release-2.x Jan 14, 2022
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