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

Rejuvenate log levels #3617

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ private void check_index(RuntimeEnvironment env) {
}
}
}
LOGGER.log(Level.FINE, "Index check for all projects done");
LOGGER.log(Level.FINER, "Index check for all projects done");
} else {
LOGGER.log(Level.FINE, "Checking index");
try {
IndexCheck.checkDir(new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR));
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "index check failed", e);
}
LOGGER.log(Level.FINE, "Index check done");
LOGGER.log(Level.FINER, "Index check done");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void deleteProject(@PathParam("project") String projectName)
projectName = Laundromat.launderInput(projectName);

Project project = disableProject(projectName);
logger.log(Level.INFO, "deleting configuration for project {0}", projectName);
logger.log(Level.FINE, "deleting configuration for project {0}", projectName);

// Delete index data associated with the project.
deleteProjectData(projectName);
Expand Down Expand Up @@ -200,7 +200,7 @@ public void deleteProjectData(@PathParam("project") String projectNameParam) {
final String projectName = Laundromat.launderInput(projectNameParam);

Project project = disableProject(projectName);
logger.log(Level.INFO, "deleting data for project {0}", projectName);
logger.log(Level.FINE, "deleting data for project {0}", projectName);

// Delete index and xrefs.
for (String dirName: new String[]{IndexDatabase.INDEX_DIR, IndexDatabase.XREF_DIR}) {
Expand Down Expand Up @@ -229,7 +229,7 @@ public void deleteHistoryCache(@PathParam("project") String projectName) {
projectName = Laundromat.launderInput(projectName);

Project project = disableProject(projectName);
logger.log(Level.INFO, "deleting history cache for project {0}", projectName);
logger.log(Level.FINE, "deleting history cache for project {0}", projectName);

List<RepositoryInfo> repos = env.getProjectRepositoriesMap().get(project);
if (repos == null || repos.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void reloadIncludes() {
public void loadPathDescriptions(@Valid final PathDescription[] descriptions) throws IOException {
EftarFile ef = new EftarFile();
ef.create(Set.of(descriptions), env.getDtagsEftarPath().toString());
LOGGER.log(Level.INFO, "reloaded path descriptions with {0} entries", descriptions.length);
LOGGER.log(Level.FINE, "reloaded path descriptions with {0} entries", descriptions.length);
}

@GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void init() {

@Override
public void onConfigurationChanged() {
LOGGER.log(Level.FINER, "refreshing token cache");
LOGGER.log(Level.FINEST, "refreshing token cache");
setTokens(RuntimeEnvironment.getInstance().getAuthenticationTokens());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private List<NamedIndexReader> getNamedIndexReaders(
/** {@inheritDoc} */
@Override
public void refresh() {
logger.log(Level.FINE, "Refreshing suggester for new configuration {0}", env.getSuggesterConfig());
logger.log(Level.FINER, "Refreshing suggester for new configuration {0}", env.getSuggesterConfig());
lock.writeLock().lock();
try {
// close and init from scratch because many things may have changed in the configuration
Expand Down Expand Up @@ -309,7 +309,7 @@ private void initSuggester() {
if (rebuildParalleismLevel == 0) {
rebuildParalleismLevel = 1;
}
logger.log(Level.FINER, "Suggester rebuild parallelism level: " + rebuildParalleismLevel);
logger.log(Level.FINEST, "Suggester rebuild parallelism level: " + rebuildParalleismLevel);
suggester = new Suggester(suggesterDir,
suggesterConfig.getMaxResults(),
Duration.ofSeconds(suggesterConfig.getBuildTerminationTime()),
Expand Down Expand Up @@ -367,7 +367,7 @@ private void scheduleRebuild() {
return;
}

logger.log(Level.INFO, "Scheduling suggester rebuild in {0}", timeToNextRebuild);
logger.log(Level.FINE, "Scheduling suggester rebuild in {0}", timeToNextRebuild);

future = instance.scheduler.schedule(instance.getRebuildAllProjectsRunnable(), timeToNextRebuild.toMillis(),
TimeUnit.MILLISECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private void init(Map<String, Object> parameters) {
throw new IllegalArgumentException(String.format("Unable to read the file \"%s\"", filePath), e);
}

LOGGER.log(Level.FINE, "LdapAttrPlugin plugin loaded with attr={0}, whitelist={1} ({2} entries), " +
LOGGER.log(Level.FINER, "LdapAttrPlugin plugin loaded with attr={0}, whitelist={1} ({2} entries), " +
"instance={3}", new Object[]{ldapAttr, filePath, whitelist.size(), ldapUserInstance});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void load(Map<String, Object> parameters) {
loadTransforms(transformsString);
}

LOGGER.log(Level.FINE, "LdapFilter plugin loaded with filter={0}, instance={1}, transforms={2}",
LOGGER.log(Level.FINER, "LdapFilter plugin loaded with filter={0}, instance={1}, transforms={2}",
new Object[]{ldapFilter, ldapUserInstance, transforms});
}

Expand Down Expand Up @@ -135,7 +135,7 @@ public void fillSession(HttpServletRequest req, User user) {
AbstractLdapProvider ldapProvider = getLdapProvider();
try {
if ((ldapProvider.lookupLdapContent(null, expandedFilter)) == null) {
LOGGER.log(Level.FINER,
LOGGER.log(Level.FINE,
"empty content for LDAP user {0} with filter ''{1}'' on {2}",
new Object[]{ldapUser, expandedFilter, ldapProvider});
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void init(Map<String, Object> parameters) {
instance = Integer.parseInt(instance_param);
}

LOGGER.log(Level.FINE, "LdapUser plugin loaded with filter={0}, " +
LOGGER.log(Level.FINER, "LdapUser plugin loaded with filter={0}, " +
"attributes={1}, useDN={2}, instance={3}",
new Object[]{ldapFilter, attributes, useDN, instance});
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/src/main/java/opengrok/auth/plugin/UserPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void load(Map<String, Object> parameters) {
DECODER_CLASS_PARAM, UserPlugin.class.getName()));
}

LOGGER.log(Level.INFO, "loading decoder: {0}", decoder_name);
LOGGER.log(Level.FINE, "loading decoder: {0}", decoder_name);
try {
decoder = getDecoder(decoder_name);
} catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void load(Map<String, Object> parameters) {
throw new IllegalArgumentException(String.format("Unable to read the file \"%s\"", filePath), e);
}

LOGGER.log(Level.FINE, "UserWhiteList plugin loaded with filePath={0} ({1} entries), fieldName={2}",
LOGGER.log(Level.FINER, "UserWhiteList plugin loaded with filePath={0} ({1} entries), fieldName={2}",
new Object[]{filePath, whitelist.size(), fieldName});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private void setWebHooks(WebHooks webHooks) {
* Go through all servers in the pool and record the first working.
*/
void prepareServers() {
LOGGER.log(Level.FINER, "checking servers for {0}", this);
LOGGER.log(Level.FINEST, "checking servers for {0}", this);
for (int i = 0; i < servers.size(); i++) {
LdapServer server = servers.get(i);
if (server.isWorking() && actualServer == -1) {
Expand All @@ -206,7 +206,7 @@ void prepareServers() {
}

// Close the connections to the inactive servers.
LOGGER.log(Level.FINER, "closing unused servers");
LOGGER.log(Level.FINEST, "closing unused servers");
for (int i = 0; i < servers.size(); i++) {
if (i != actualServer) {
servers.get(i).close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public synchronized boolean isWorking() {
* @return the new connection or null
*/
private synchronized LdapContext connect() {
LOGGER.log(Level.INFO, "Connecting to LDAP server {0} ", this);
LOGGER.log(Level.FINE, "Connecting to LDAP server {0} ", this);

if (errorTimestamp > 0 && errorTimestamp + interval > System.currentTimeMillis()) {
LOGGER.log(Level.WARNING, "LDAP server {0} is down", this.url);
Expand All @@ -269,7 +269,7 @@ private synchronized LdapContext connect() {
try {
ctx = new InitialLdapContext(env, null);
ctx.setRequestControls(null);
LOGGER.log(Level.INFO, "Connected to LDAP server {0}", this);
LOGGER.log(Level.FINE, "Connected to LDAP server {0}", this);
errorTimestamp = 0;
} catch (NamingException ex) {
LOGGER.log(Level.WARNING, "LDAP server {0} is not responding", env.get(Context.PROVIDER_URL));
Expand Down
8 changes: 4 additions & 4 deletions suggester/src/main/java/org/opengrok/suggest/Suggester.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private void shutdownAndAwaitTermination(final ExecutorService executorService,
executorService.awaitTermination(awaitTerminationTime.toMillis(), TimeUnit.MILLISECONDS);
Duration duration = Duration.between(start, Instant.now());
timer.record(duration);
LOGGER.log(Level.INFO, "{0} (took {1})", new Object[]{logMessageOnSuccess,
LOGGER.log(Level.FINE, "{0} (took {1})", new Object[]{logMessageOnSuccess,
DurationFormatUtils.formatDurationWords(duration.toMillis(),
true, true)});
} catch (InterruptedException e) {
Expand Down Expand Up @@ -292,7 +292,7 @@ public void rebuild(final Collection<NamedIndexDir> indexDirs) {
}

Instant start = Instant.now();
LOGGER.log(Level.INFO, "Rebuilding the following suggesters: {0}", indexDirs);
LOGGER.log(Level.FINE, "Rebuilding the following suggesters: {0}", indexDirs);

ExecutorService executor = Executors.newWorkStealingPool(rebuildParallelismLevel);

Expand Down Expand Up @@ -343,7 +343,7 @@ private Runnable getRebuildRunnable(final SuggesterProjectData data) {
}

Instant start = Instant.now();
LOGGER.log(Level.FINE, "Rebuilding {0}", data);
LOGGER.log(Level.FINER, "Rebuilding {0}", data);
data.rebuild();

Duration d = Duration.between(start, Instant.now());
Expand All @@ -364,7 +364,7 @@ public void remove(final Iterable<String> names) {
}

synchronized (lock) {
LOGGER.log(Level.INFO, "Removing following suggesters: {0}", names);
LOGGER.log(Level.FINE, "Removing following suggesters: {0}", names);

for (String suggesterName : names) {
SuggesterProjectData collection = projectData.get(suggesterName);
Expand Down