Skip to content

Cannot apply changes a logging implementation at some class #1272

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

Closed
kazuki43zoo opened this issue May 4, 2018 · 1 comment
Closed

Cannot apply changes a logging implementation at some class #1272

kazuki43zoo opened this issue May 4, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@kazuki43zoo
Copy link
Member

MyBatis version

3.4.6 (Probably all versions)

Database vendor and version

Any

Test case or example project

None

Steps to reproduce

  1. Change to JKD14 as follow:
sqlSessionFactory.getConfiguration().setAutoMappingUnknownColumnBehavior(AutoMappingUnknownColumnBehavior.WARNING);
sqlSessionFactory.getConfiguration().setLogImpl(Jdk14LoggingImpl.class); // Change to JDK14
  1. Run an application

Expected result

Output a log using the logger of JDK14(via specified log implementation).

Actual result

But output a log using the logger of SLF4J(In my application, SLF4J's provider is log4j). this changes cannot apply to some class.

@kazuki43zoo kazuki43zoo added the bug label May 4, 2018
@kazuki43zoo
Copy link
Member Author

kazuki43zoo commented May 4, 2018

In this current implementation, the logger initialization has been performed before applying a logger configuration.

For example:

private static final Log log = LogFactory.getLog(AutoMappingUnknownColumnBehavior.class);

private static final Log log = LogFactory.getLog(JavassistProxyFactory.class);

Loggers of these classes has been initialized before applying logger configuration because the Configuration class refers these classes.

kazuki43zoo added a commit to kazuki43zoo/mybatis-3 that referenced this issue May 4, 2018
* Support the lazy initialization log
* Move the log configuration timing for xml config

Fixes mybatisgh-1272
kazuki43zoo added a commit to kazuki43zoo/mybatis-3 that referenced this issue May 4, 2018
* Support the lazy initialization log
* Move the log configuration timing for xml config

Fixes mybatisgh-1272
kazuki43zoo added a commit to kazuki43zoo/mybatis-3 that referenced this issue May 4, 2018
* Support the lazy initialization log
* Move the log configuration timing for xml config

Fixes mybatisgh-1272
@kazuki43zoo kazuki43zoo self-assigned this Dec 9, 2018
@kazuki43zoo kazuki43zoo added this to the 3.5.0 milestone Dec 9, 2018
kazuki43zoo added a commit to kazuki43zoo/mybatis-3 that referenced this issue Dec 9, 2018
kazuki43zoo added a commit that referenced this issue Dec 9, 2018
Fix log initialization timing on some class
pulllock pushed a commit to pulllock/mybatis-3 that referenced this issue Oct 19, 2023
pulllock pushed a commit to pulllock/mybatis-3 that referenced this issue Oct 19, 2023
Fix log initialization timing on some class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant