Skip to content

Commit

Permalink
Reduce logging noise from WebHook components Fixes #153
Browse files Browse the repository at this point in the history
Some TeamCity pages had protected constructors - now made public.
Lots of noisy logging messages reduced from INFO to DEBUG.

Hopefully, the logging level is not more useful and less verbose for
uses with the minimum level set to INFO (the default for a TeamCity
install).
  • Loading branch information
netwolfuk committed Mar 13, 2020
1 parent 1ae80d2 commit 0a1f1fd
Show file tree
Hide file tree
Showing 12 changed files with 805 additions and 808 deletions.
828 changes: 414 additions & 414 deletions tcwebhooks-core/src/main/java/webhook/teamcity/WebHookListener.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class WebHookAuthenticatorProvider {
HashMap<String, WebHookAuthenticatorFactory> types = new HashMap<>();

public WebHookAuthenticatorProvider(){
Loggers.SERVER.info("WebHookAuthenticatorProvider :: Starting");
Loggers.SERVER.debug("WebHookAuthenticatorProvider :: Starting");
}

public void registerAuthType(WebHookAuthenticatorFactory authType){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class WebHookPayloadManager {

public WebHookPayloadManager(SBuildServer server){
this.server = server;
Loggers.SERVER.info("WebHookPayloadManager :: Starting");
Loggers.SERVER.debug("WebHookPayloadManager :: Starting");
}

public void registerPayloadFormat(WebHookPayload payloadFormat){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public WebHookTemplateFileChangeHandler(
this.webHookPayloadManager = webHookPayloadManager;
this.webHookTemplateJaxHelper = webHookTemplateJaxHelper;
this.serverPaths = serverPaths;
Loggers.SERVER.info("WebHookTemplateFileChangeHandler :: Starting");
Loggers.SERVER.debug("WebHookTemplateFileChangeHandler :: Starting");
}

public void register(){
Loggers.SERVER.info("WebHookTemplateFileChangeHandler :: Registering");
Loggers.SERVER.debug("WebHookTemplateFileChangeHandler :: Registering");
this.configFile = new File(this.serverPaths.getConfigDir() + File.separator + "webhook-templates.xml");

this.fw = new FileWatcher(configFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class WebHookTemplateManager {
public WebHookTemplateManager(WebHookPayloadManager webHookPayloadManager, WebHookTemplateJaxHelper webHookTemplateJaxHelper){
this.webHookPayloadManager = webHookPayloadManager;
this.webHookTemplateJaxHelper = webHookTemplateJaxHelper;
Loggers.SERVER.info("WebHookTemplateManager :: Starting (" + toString() + ")");
Loggers.SERVER.debug("WebHookTemplateManager :: Starting (" + toString() + ")");
}

public void registerTemplateFormatFromSpring(WebHookPayloadTemplate payloadTemplate){
Expand All @@ -43,9 +43,9 @@ public void registerTemplateFormatFromSpring(WebHookPayloadTemplate payloadTempl
+ " with rank of " + payloadTemplate.getRank());
springTemplates.put(payloadTemplate.getTemplateId(),payloadTemplate);
rebuildOrderedListOfTemplates();
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
for (WebHookPayloadTemplate pl : this.orderedTemplateCollection){
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateDescription() + " (" + pl.getTemplateId() + ")" + " Rank: " + pl.getRank());
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateDescription() + " (" + pl.getTemplateId() + ")" + " Rank: " + pl.getRank());
}
}
}
Expand All @@ -64,9 +64,9 @@ public void registerTemplateFormatFromXmlEntity(WebHookTemplateEntity payloadTem
synchronized (orderedTemplateCollection) {
registerTemplateFormatFromXmlEntityUnsyncd(payloadTemplate);
rebuildOrderedListOfTemplates();
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
for (WebHookPayloadTemplate pl : this.orderedTemplateCollection){
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateId() + " Rank: " + pl.getRank());
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateId() + " Rank: " + pl.getRank());
}
}
}
Expand All @@ -76,15 +76,15 @@ public void registerTemplateFormatFromXmlConfig(WebHookTemplateConfig payloadTem
synchronized (orderedTemplateCollection) {
registerTemplateFormatFromXmlEntityUnsyncd(payloadTemplate);
rebuildOrderedListOfTemplates();
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
for (WebHookPayloadTemplate pl : this.orderedTemplateCollection){
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateId() + " Rank: " + pl.getRank());
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateId() + " Rank: " + pl.getRank());
}
}
}

private void unregisterAllXmlConfigTemplates(){
Loggers.SERVER.info(this.getClass().getSimpleName() + " :: un-registering all XML config templates.");
Loggers.SERVER.debug(this.getClass().getSimpleName() + " :: un-registering all XML config templates.");
xmlConfigTemplates.clear();
rebuildOrderedListOfTemplates();
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
Expand Down Expand Up @@ -248,9 +248,9 @@ public boolean removeXmlConfigTemplateFormat(String name) {
Loggers.SERVER.info(this.getClass().getSimpleName() + " :: Deleting XML template "
+ name);
rebuildOrderedListOfTemplates();
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
for (WebHookPayloadTemplate pl : this.orderedTemplateCollection){
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateId() + " Rank: " + pl.getRank());
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateId() + " Rank: " + pl.getRank());
}
return true;
}
Expand All @@ -265,9 +265,9 @@ public void registerAllXmlTemplates(WebHookTemplates templatesList) {
this.registerTemplateFormatFromXmlEntityUnsyncd(template);
}
rebuildOrderedListOfTemplates();
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATES_LIST_IS + this.orderedTemplateCollection.size() + TEMPLATES_ARE_RANKED_IN_THE_FOLLOWING_ORDER);
for (WebHookPayloadTemplate pl : this.orderedTemplateCollection){
Loggers.SERVER.info(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateId() + " Rank: " + pl.getRank());
Loggers.SERVER.debug(this.getClass().getSimpleName() + TEMPLATE_NAME + pl.getTemplateId() + " Rank: " + pl.getRank());
}
}
}
Expand Down
Loading

0 comments on commit 0a1f1fd

Please sign in to comment.