DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Discussion on: My project on github.

Collapse
dagnelies profile image
Arnaud Dagnelies • Edited on

Oh no! ... Please not yet another logging framework for Java! One of the most widespread issue with Java is that multiple Logging frameworks coexist and the community is fragmented, leading to all kind of complications. I guess this additional library would add one more brick to this disaster. Sorry.

I'm sure your talent could be spent on more useful things.

Collapse
optijava profile image
OptiJava Author

You're right. I didn't think about this before.But I want to ask what exactly does complications mean?

Collapse
dagnelies profile image
Arnaud Dagnelies • Edited on

One must be aware that the logging is not only done by your own code, but also by all the third party libraries used. Everyone logs stuff, using different logging frameworks, and yet you need your logging configuration to apply to all of them. If I change my logging level from WARN to DEBUG, I want all libs to pick it up, and not have one dependency ignore it because it uses a separate logging which requires its own distinct config.

Thread Thread
optijava profile image
OptiJava Author

I understand what you mean.If a dependency use logging framework A,but my project use logging framework B.If I want to apply my configuration to all dependency and my project,I have to create many configure files for all logging framework.
Thanks.

Thread Thread
201206030 profile image
xxyopen

As long as only the SLF4J API is used in the Java code, there will be no such problems

Collapse
201206030 profile image
xxyopen

I think it's not a big problem as long as the specification of SLF4J is implemented

Collapse
201206030 profile image
xxyopen

It's not that we don't need to innovate when we have it on the market. Sometimes the existing framework can't meet our needs.

Collapse
optijava profile image
OptiJava Author

I have an immature idea.
I think the most big question is configuration, i can let Optilog control other logging framework's configuration.When you write Optilog's config file,Optilog auto generate configure file that other logging framework need(in runtime),that config is same as Optilog's configure file.If you change configure file,Optilog will change the configure file for other logging framework.
Maybe this idea is unrealistic...

Thread Thread
dagnelies profile image
Arnaud Dagnelies

Instead of making your logging library, I would ask two questions:

  • Why do we need yet another logging library?
  • Cannot we rather contribute to the existing ones?
Thread Thread
optijava profile image
OptiJava Author

First,because I want to make a better logging framework,that doesn't mean I think they are too bad.They have some problems.
problem example:
public class Test {
public static Logger log = LoggerFactory.getLogger(Test.class);
public static void main(String[] args) {
log.info("test in Test");
test2.t(log);
}
}
class test2 {
public static void t(Logger logger) {
logger.info("test in test2");
}
}

console:
[main] INFO com.test.Test - test in Test
[main] INFO com.test.Test - test in test2

Why second log in class test2 print class:com.test.Test?

I once want to contribute these logging framework.But if you see their pull request,you will know they will not access you.
github.com/qos-ch/slf4j/pulls
github.com/apache/logging-log4j2/p...