Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[LOGTOOL-146] Add an attribute the LogMessage annotation which allows… #82

Merged
merged 1 commit into from
Jun 8, 2021

Conversation

jamezp
Copy link
Member

@jamezp jamezp commented Jun 8, 2021

… the generated code to set and reset the current threads context class loader during a log statement.

https://issues.redhat.com/browse/LOGTOOL-146

An example message gets generated as:

@Override
public final void noFormatWithCause(final Throwable cause) {
    final ClassLoader currentTccl = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
        super.log.log(FQCN, INFO, noFormatWithCause$str(), null, cause);
    } finally {
        Thread.currentThread().setContextClassLoader(currentTccl);
    }
}

… the generated code to set and reset the current threads context class loader during a log statement.

https://issues.redhat.com/browse/LOGTOOL-146
@jamezp jamezp merged commit 36822ff into jboss-logging:master Jun 8, 2021
@jamezp jamezp deleted the LOGTOOL-146 branch June 8, 2021 23:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant