Skip to content

Commit

Permalink
refactor: fix logs
Browse files Browse the repository at this point in the history
  • Loading branch information
NiccoMlt committed Nov 8, 2024
1 parent 81d2a83 commit 10ea9a7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public void commitConfiguration(ConfigurationStore newConfigurationStore) {
PreparedStatement psInsert = con.prepareStatement(INSERT_INTO_CONFIG_TABLE)) {
newConfigurationStore.forEach((k, v) -> {
try {
LOG.info("Saving ''{}''=''{}''", k, v);
LOG.info("Saving \"{}\"=\"{}\"", k, v);
currentKeys.remove(k);
newProperties.put(k, v);
psUpdate.setString(1, v);
Expand All @@ -306,7 +306,7 @@ public void commitConfiguration(ConfigurationStore newConfigurationStore) {
});
currentKeys.forEach(k -> {
try {
LOG.info("Deleting ''{}''", k);
LOG.info("Deleting \"{}\"", k);
psDelete.setString(1, k);
psDelete.executeUpdate();
} catch (SQLException err) {
Expand Down Expand Up @@ -554,7 +554,7 @@ public String loadAcmeChallengeToken(String id) {
public void deleteAcmeChallengeToken(String id) {
try (Connection con = datasource.getConnection();
PreparedStatement psDelete = con.prepareStatement(DELETE_FROM_ACME_CHALLENGE_TOKENS_TABLE)) {
LOG.info("Deleting ACME challenge token with id''{}''", id);
LOG.info("Deleting ACME challenge token with id \"{}\"", id);
psDelete.setString(1, id);
psDelete.executeUpdate();
} catch (SQLException err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ private void readClusterConfiguration(ConfigurationStore staticConfiguration) th
zkSecure = staticConfiguration.getBoolean("zkSecure", false);
zkTimeout = staticConfiguration.getInt("zkTimeout", 40_000);
zkProperties = new Properties(staticConfiguration.asProperties("zookeeper."));
LOG.info("mode=cluster, zkAddress=''{}'',zkTimeout={}, peer.id=''{}'', zkSecure: {}", zkAddress, zkTimeout, peerId, zkSecure);
LOG.info("mode=cluster, zkAddress=\"{}\", zkTimeout={}, peer.id=\"{}\", zkSecure: {}", zkAddress, zkTimeout, peerId, zkSecure);
zkProperties.forEach((k, v) -> LOG.info("additional zkclient property: {}={}", k, v));
break;
case "standalone":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public boolean performStaplingForCertificate(Certificate[] chain) throws IOExcep
LOG.info("OCSP Responder URI: {}", uri);

if (uri == null) {
LOG.info("The CA/certificate doesn''t have an OCSP responder, skipping OCSP stapling for {}", dn);
LOG.info("The CA/certificate doesn't have an OCSP responder, skipping OCSP stapling for {}", dn);
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY RICHARD KENNARD ''AS IS'' AND ANY
// THIS SOFTWARE IS PROVIDED BY RICHARD KENNARD "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL RICHARD KENNARD BE LIABLE FOR ANY
Expand Down Expand Up @@ -91,15 +91,15 @@
* string:
* <p>
* <code>
* URI uri = new URI("http://java.sun.com?forum=2");<br/>
* URI uri = new URI("http://java.sun.com?forum=2");<br/>
* UrlEncodedQueryString queryString = UrlEncodedQueryString.parse(uri);<br/>
* System.out.println(queryString.get("forum"));<br/>
* </code>
* <h4>Modifying parameters</h4> UrlEncodedQueryString can be used to set,
* append or remove parameters from a query string:
* <p>
* <code>
* URI uri = new URI("/forum/article.jsp?id=2&amp;para=4");<br/>
* URI uri = new URI("/forum/article.jsp?id=2&amp;para=4");<br/>
* UrlEncodedQueryString queryString = UrlEncodedQueryString.parse(uri);<br/>
* queryString.set("id", 3);<br/>
* queryString.remove("para");<br/>
Expand All @@ -113,7 +113,7 @@
* modified query string back to a URI, creating a new URI:
* <p>
* <code>
* URI uri = new URI("/forum/article.jsp?id=2");<br/>
* URI uri = new URI("/forum/article.jsp?id=2");<br/>
* UrlEncodedQueryString queryString = UrlEncodedQueryString.parse(uri);<br/>
* queryString.set("id", 3);<br/>
* uri = queryString.apply(uri);<br/>
Expand Down Expand Up @@ -151,7 +151,7 @@ public class UrlEncodedQueryString {
* <em>One</em> separator may be passed to <code>toString</code> and
* <code>apply</code> when outputting query strings.
*/
public static enum Separator {
public enum Separator {
/**
* An ampersand <code>&amp;</code> - the separator recommended by <a
* href="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1">HTML
Expand Down Expand Up @@ -423,7 +423,7 @@ public UrlEncodedQueryString set(final String name, final String value) {
* for auto-boxing. For example:
* <p>
* <code>
* queryString.set( "id", 3 );<br/>
* queryString.set( "id", 3 );<br/>
* </code>
*
* @param name name of the query parameter
Expand Down Expand Up @@ -497,7 +497,7 @@ public UrlEncodedQueryString append(final String name, final String value) {
* suitable for auto-boxing. For example:
* <p>
* <code>
* queryString.append( "id", 3 );<br/>
* queryString.append( "id", 3 );<br/>
* </code>
*
* @param name name of the query parameter
Expand Down Expand Up @@ -805,8 +805,7 @@ private void appendOrSet(String name, final String value, final boolean append)
listValues.add(value);
return;
}
} // ...otherwise, if we're setting and the value is null...
else if (value == null) {
} else if (value == null) { // ...otherwise, if we're setting and the value is null...
// ...remove it

this.queryMap.remove(name);
Expand All @@ -823,7 +822,7 @@ else if (value == null) {
/**
* Helper method for append and set
*
* @param query <code>www-form-urlencoded</code> string
* @param parameters <code>www-form-urlencoded</code> string
* @param append whether to append (or set)
*/
private void appendOrSet(final CharSequence parameters, final boolean append) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private final class RandomBackendSelector implements BackendSelector {
public List<String> selectBackends(String userId, String sessionId, String director) {
DirectorConfiguration directorConfig = directors.get(director);
if (directorConfig == null) {
LOG.error("Director ''{}'' not configured, while handling request + userId={} sessionId={}", director, userId, sessionId);
LOG.error("Director \"{}\" not configured, while handling request + userId={} sessionId={}", director, userId, sessionId);
return Collections.emptyList();
}
if (directorConfig.getBackends().contains(ALL_BACKENDS)) {
Expand Down Expand Up @@ -149,7 +149,7 @@ public MapResult map(ProxyRequest request) {

ActionConfiguration action = actions.get(route.getAction());
if (action == null) {
LOG.info("no action ''{}'' -> not-found for {}, valid {}", route.getAction(), request.getUri(), actions.keySet());
LOG.info("no action \"{}\" -> not-found for {}, valid {}", route.getAction(), request.getUri(), actions.keySet());
return MapResult.internalError(route.getId());
}
if (ActionConfiguration.TYPE_REDIRECT.equals(action.getType())) {
Expand Down

0 comments on commit 10ea9a7

Please sign in to comment.