Skip to content

Commit

Permalink
Adding information about classes and methods to log message format
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Feb 9, 2018
1 parent cc5e868 commit 3354777
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.Level;
Expand Down Expand Up @@ -78,6 +79,8 @@ public synchronized String format(final LogRecord record) {
buffer.append(timestampFormatter.format(new Date(record.getMillis())));
buffer.append(' ');
buffer.append(levelNumberToCommonsLevelName(record.getLevel()));
String[] parts = record.getSourceClassName().split("\\.");
buffer.append(" [" + parts[parts.length-1] + "." + record.getSourceMethodName() + "]");
buffer.append(SUFFIX);
buffer.append(formatMessage(record)).append(lineSeparator);
if (record.getThrown() != null) {
Expand Down

0 comments on commit 3354777

Please sign in to comment.