logging-log4j2 icon indicating copy to clipboard operation
logging-log4j2 copied to clipboard

Added java logging with Asynchronous logger

Open ruhulmus opened this issue 3 years ago • 14 comments

log4j2 logging using java 8 and maven 3 Implement Asynchronous Loggers.

ruhulmus avatar Feb 20 '22 11:02 ruhulmus

@ruhulmus Please describe what is the goal of this PR. It does not seem to fit in the project. Why a new module and so on? None of the files have the proper Apache license header as well.

garydgregory avatar Feb 20 '22 11:02 garydgregory

@ruhulmus Please describe what is the goal of this PR. It does not seem to fit in the project. Why a new module and so on? None of the files have the proper Apache license header as well.

Thanks for your feedback. The goal of this PR is mainly to add Asynchronous Loggers for Low-Latency Logging into Java maven-based project. here is the link: https://logging.apache.org/log4j/2.x/manual/async.html

N.B : Already Added Apache license in the headers

ruhulmus avatar Feb 20 '22 11:02 ruhulmus

Hello @ruhulmus This looks like an example app and configuration. I do not see why it belongs in the Log4j runtime. What am I missing?

garydgregory avatar Feb 20 '22 15:02 garydgregory

Hello @ruhulmus This looks like an example app and configuration. I do not see why it belongs in the Log4j runtime. What am I missing?

Here, logs are running Asynchronously using Log4j on the java maven project. Async logger is one of Log4j2's strong points. And it belongs in the Log4j runtime. This mechanism increased the logging performance and provide lower logging latency and higher throughput. I hope now it's bit clear :)

ruhulmus avatar Feb 20 '22 20:02 ruhulmus

@ruhulmus If this is an example for people, showing them how to use Async logging, then what would be the best place so that people can easily find it? Maybe in the docs? What does it add that the existing docs are missing? (And would it be an idea to improve the existing docs, if that is the case.)

remkop avatar Feb 20 '22 21:02 remkop

@ruhulmus If this is an example for people, showing them how to use Async logging, then what would be the best place so that people can easily find it? Maybe in the docs? What does it add that the existing docs are missing? (And would it be an idea to improve the existing docs, if that is the case.)

Ok Sure, Then I will move into the right sections and can make a details doc. so anyone can better understand. The main reason to share it within the community, it's an important use case for log4j2, especially in java based projects. Thanks for your feedback :).

ruhulmus avatar Feb 21 '22 06:02 ruhulmus

@ruhulmus If this is an example for people, showing them how to use Async logging, then what would be the best place so that people can easily find it? Maybe in the docs? What does it add that the existing docs are missing? (And would it be an idea to improve the existing docs, if that is the case.)

@remkop, I have moved the project under the Docs directory and made detailed documentation with examples for the user's better understanding. I believe it will be helpful for the community.

ruhulmus avatar Feb 21 '22 11:02 ruhulmus

@remkop, Could you please review the changes? I have made updates based on the last discussion.

ruhulmus avatar Feb 22 '22 13:02 ruhulmus

Hi @remkop, Did you review the latest one? may I ask What is the additional process for the merge :)? or any additional thing needed? Looking for your feedback :).

ruhulmus avatar Apr 07 '22 20:04 ruhulmus

@ruhulmus, I also agree with Gary and Remko: I fail to see the point of this new Maven artifact. What does it have that is missing in the official documentation?

ppkarwasz avatar Apr 07 '22 20:04 ppkarwasz

@ruhulmus, I also agree with Gary and Remko: I fail to see the point of this new Maven artifact. What does it have that is missing in the official documentation?

@ppkarwasz, Thanks for your feedback. It is an example and documentation of people who want to use Async logging in java projects. The main reason to share it within the community, it's an important use case for log4j2 with java and I believe it will be helpful for the community :). If possible you can check the documentation for better understanding.

ruhulmus avatar Apr 07 '22 22:04 ruhulmus

@ruhulmus Thank you for your patience and persistence.

What you are proposing (if I understand correctly) is quite different from what we have at the moment.

  • All of the submodules currently in the log4j project produce JAR files that are published to Maven Central. Each submodule contains a src/main folder where the source code for the artifact lives, a src/test folder for the test code (test JAR files are note published to Maven), and a src/site folder with some documentation for that submodule that will be converted to HTML and published on the Log4j web site.
  • For documentation, we have "source" files under logging-log4j2/src/site: src/site/asciidoc, src/site/markdown, and src/site/xdoc (this is a bit cleaner in the 3.0 branch), these "source files" are converted to PDF and HTML and are published on the Log4j web site under https://logging.apache.org/log4j/2.x/manual

What you are proposing is a different kind of documentation, essentially an example project that people can either browse via GitHub's web interface, or clone/download to build and modify it locally.

This is an interesting idea, and I can see the value in something like that, not just for Async Loggers, but also for other features. (We have something similar in the https://github.com/apache/logging-log4j-audit-sample repo.)

It may make sense to create a separate github repo for this. Perhaps we can call it something like logging-log4j-examples. This could be a documentation-only repo, that is not intended to publish artifacts.

For the main Log4j repo (https://github.com/apache/logging-log4j), the threshold for accepting external contributions is quite high. One of the advantages of having a separate repo for example code is that we can be less strict about merging pull requests into that separate repo, so we can accept more contributions without spending much time on fine-tuning and polishing it.

I wonder what the other Log4j committers think of this?

remkop avatar Apr 08 '22 02:04 remkop

logging-log4j-examples

@ruhulmus Thank you for your patience and persistence.

What you are proposing (if I understand correctly) is quite different from what we have at the moment.

  • All of the submodules currently in the log4j project produce JAR files that are published to Maven Central. Each submodule contains a src/main folder where the source code for the artifact lives, a src/test folder for the test code (test JAR files are note published to Maven), and a src/site folder with some documentation for that submodule that will be converted to HTML and published on the Log4j web site.
  • For documentation, we have "source" files under logging-log4j2/src/site: src/site/asciidoc, src/site/markdown, and src/site/xdoc (this is a bit cleaner in the 3.0 branch), these "source files" are converted to PDF and HTML and are published on the Log4j web site under https://logging.apache.org/log4j/2.x/manual

What you are proposing is a different kind of documentation, essentially an example project that people can either browse via GitHub's web interface, or clone/download to build and modify it locally.

This is an interesting idea, and I can see the value in something like that, not just for Async Loggers, but also for other features. (We have something similar in the https://github.com/apache/logging-log4j-audit-sample repo.)

It may make sense to create a separate github repo for this. Perhaps we can call it something like logging-log4j-examples. This could be a documentation-only repo, that is not intended to publish artifacts.

For the main Log4j repo (https://github.com/apache/logging-log4j), the threshold for accepting external contributions is quite high. One of the advantages of having a separate repo for example code is that we can be less strict about merging pull requests into that separate repo, so we can accept more contributions without spending much time on fine-tuning and polishing it.

I wonder what the other Log4j committers think of this?

@remkop, Thank you for your valuable details explanation and feedback. I fully agree with you and that was my main intention to make this thing to share with the community. From my point of view, it's a good idea about the logging-log4j-examples repo or something like that. Lots of people are using logging-log4j for different types of projects. So it can be easier if the community found the related example in a single place. so people can share all the examples related to logging-log4j in the same repo.

if it is possible, how we can start it or What is the process we should follow? Do you have any idea ? What are the other Log4j committers think about it?

ruhulmus avatar Apr 09 '22 05:04 ruhulmus

Sorry for taking so long to notice this PR. We already have a log4j-samples module that has a sub-module for each sample. It seems to me this belongs under that.

rgoers avatar Sep 07 '22 22:09 rgoers

Sorry for taking so long to notice this PR. We already have a log4j-samples module that has a sub-module for each sample. It seems to me this belongs under that.

Sorry for taking long time to reply. Actually after long time I noticed your comment on that. @rgoers , You are right that it has a repo name log4j-samples under the main repo. But i could not find any sample or example that is releted to Async logging. Could you please send me the sample link, so i can recheck again.

Basically, The main reason to share that example within the community, who want to use Async logging in java projects using log4j2. If possible you can check the documentation for better understanding.

ruhulmus avatar Feb 15 '23 09:02 ruhulmus

@ruhulmus,

The samples from this repo will end up in apache/logging-log4j-samples in the near future. I'll notify you, when it is done, so that you can resubmit your PR to that repo.

ppkarwasz avatar Feb 15 '23 13:02 ppkarwasz

@ruhulmus,

The samples from this repo will end up in apache/logging-log4j-samples in the near future. I'll notify you, when it is done, so that you can resubmit your PR to that repo.

@ppkarwasz , Sure. Its also a good idea i think. Thanks. Norify me when its ready . so i can make PR into that repo.

ruhulmus avatar Feb 16 '23 03:02 ruhulmus

@ruhulmus, the new repo is ready: https://github.com/apache/logging-log4j-tools

Please resubmit your PR there. The documentation in that repo should be in README.adoc files.

ppkarwasz avatar Feb 18 '23 00:02 ppkarwasz

README.adoc

@ppkarwasz, Many thanks for the update. I have already Make the PR to that repo. Please check it. Thanks again for your worthwhile effort for the community.

ruhulmus avatar Feb 18 '23 18:02 ruhulmus