Skip to content

Commit

Permalink
refactor: move ClientTraceIdSimpleFormatter class to logging package
Browse files Browse the repository at this point in the history
Signed-off-by: Zvi Grinberg <zgrinber@redhat.com>
  • Loading branch information
zvigrinberg committed Feb 15, 2024
1 parent e56f789 commit 9173b79
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ limitations under the License.]]>
<exclude>com/redhat/exhort/exception/*</exclude>
<!-- This one excluding ExhortApi implementation calss from coverage report as it's not tested by surefire plugin, but with junit-platform-maven-plugin -->
<exclude>com/redhat/exhort/impl/*</exclude>
<exclude>com/redhat/exhort/logging/*</exclude>

</excludes>
<propertyName>jacoco.java.option</propertyName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.redhat.exhort.impl;
package com.redhat.exhort.logging;

import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.redhat.exhort.impl.RequestManager;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand Down Expand Up @@ -77,7 +78,7 @@ public String format(LogRecord record) {
// message,
// throwable);
messageKeysValues.put("timestamp",zdt.toString());
messageKeysValues.put("ex-client-trace-id",RequestManager.getInstance().getTraceIdOfRequest());
messageKeysValues.put("ex-client-trace-id", RequestManager.getInstance().getTraceIdOfRequest());
messageKeysValues.put("methodName",source);
messageKeysValues.put("loggerName",record.getLoggerName());
messageKeysValues.put("logLevel",record.getLevel().toString());
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/redhat/exhort/logging/LoggersFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.redhat.exhort.logging;

import com.redhat.exhort.impl.ClientTraceIdSimpleFormatter;

import java.util.logging.ConsoleHandler;
import java.util.logging.Logger;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
opens com.redhat.exhort.sbom to com.fasterxml.jackson.databind, packageurl.java;
opens com.redhat.exhort.api.serialization to com.fasterxml.jackson.databind;
exports com.redhat.exhort.providers;
exports com.redhat.exhort.logging;
}

0 comments on commit 9173b79

Please sign in to comment.