Skip to content

Commit

Permalink
Fixed access log timestamp formatter and reduced spam in logs
Browse files Browse the repository at this point in the history
- reduced log levels in PEAccessLogValve
- when CommonAccessLogFormatterImpln.appendCurrentDate changed recently
  I removed the content but forgot to add the new impl
  • Loading branch information
dmatej committed Aug 4, 2022
1 parent 9909b9f commit 8dc037f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -43,7 +43,6 @@
import java.time.format.DateTimeFormatter;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -872,7 +871,7 @@ private synchronized void close() {
* file, and false if we have rotated
*/
private synchronized void open(String dateStamp, boolean firstAccessLogFile) throws IOException {
_logger.log(Level.WARNING, "open(dateStamp={0}, firstAccessLogFile={1}",
_logger.log(Level.CONFIG, "open(dateStamp={0}, firstAccessLogFile={1}",
new Object[] {dateStamp, firstAccessLogFile});
// Create the directory if necessary
File dir = new File(directory);
Expand Down Expand Up @@ -999,7 +998,7 @@ public void start() throws LifecycleException {
if (fileDateFormat == null) {
fileDateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd");
}
_logger.log(Level.SEVERE, "Using fileDateFormat: {0}", fileDateFormat);
_logger.log(Level.CONFIG, "Using fileDateFormat: {0}", fileDateFormat);

final long systime = System.currentTimeMillis();
try {
Expand Down
Expand Up @@ -127,7 +127,7 @@ private void appendAuthUserName(CharBuffer cb, HttpServletRequest hreq) {
*/
private void appendCurrentDate(CharBuffer cb) {
cb.put("[");

cb.put(getPattern().getDateTimeFormatter().format(getTimestamp()));
cb.put("]");
}

Expand Down

0 comments on commit 8dc037f

Please sign in to comment.