Skip to content
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

Temporarily reduce PDFBox logging level #5639

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/src/org/labkey/core/CoreModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletRegistration;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configurator;
import org.apache.pdfbox.pdmodel.font.FontMapper;
import org.apache.pdfbox.pdmodel.font.FontMappers;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -1273,6 +1275,9 @@ public void startBackgroundThreads()

// Loading the PDFBox font cache can be very slow on some agents; fill it proactively. Issue 50601
JobRunner.getDefault().execute(() -> {
Logger log = LogManager.getLogger("org.apache.pdfbox.pdmodel.font.FileSystemFontProvider");
Level level = log.getLevel();
Configurator.setLevel(log, Level.TRACE);
try
{
long start = System.currentTimeMillis();
Expand All @@ -1287,6 +1292,10 @@ public void startBackgroundThreads()
{
LOG.warn("Unable to initialize PDFBox font cache", e);
}
finally
{
Configurator.setLevel(log, level);
}
});
}

Expand Down