Skip to content

Commit

Permalink
Utility for access logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Jan 24, 2025
1 parent 0c752f5 commit faada89
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.*;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
Expand All @@ -19,6 +18,7 @@
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.stereotype.Component;

import nl.vpro.jmx.MBeans;
import nl.vpro.logging.mdc.MDCConstants;
import nl.vpro.logging.simple.Slf4jSimpleLogger;
import nl.vpro.util.*;
Expand Down Expand Up @@ -99,4 +99,18 @@ public int getTruncateAfter() {
public void setTruncateAfter(int truncateAfter) {
this.truncateAfter = truncateAfter;
}

@ManagedAttribute
public String getFilesPath() {
return filesPath == null ? null : filesPath.toString();
}

@ManagedAttribute
public void setFilesPath(String string) {
if (MBeans.isBlank(string)) {
filesPath = null;
} else {
filesPath = Paths.get(string);
}
}
}

0 comments on commit faada89

Please sign in to comment.