mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-02-12 19:31:04 +00:00
adjusted logback.xml to facilitate two populated logs for different purposes; brief pass over all instance of log calls
This commit is contained in:
parent
873f19db5e
commit
39d68b537d
28 changed files with 365 additions and 316 deletions
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) 2021 PSForever
|
||||
package net.psforever.filters;
|
||||
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.filter.Filter;
|
||||
import ch.qos.logback.core.spi.FilterReply;
|
||||
|
||||
/**
|
||||
* Disrupts a variety of logging messages that originate from specific loggers.
|
||||
* A comparison of the prefix text of the logger handling the event is performed,
|
||||
* with a positive match denying that event being appended.
|
||||
* The full prefix must be provided, as the is occasionally appear in an abbreviated form.
|
||||
*/
|
||||
public class LoggerPrefixFilter extends Filter<ILoggingEvent> {
|
||||
private String prefix;
|
||||
|
||||
@Override
|
||||
public FilterReply decide(ILoggingEvent event) {
|
||||
if (isStarted() && event.getLoggerName().startsWith(prefix)) {
|
||||
return FilterReply.DENY;
|
||||
} else {
|
||||
return FilterReply.NEUTRAL;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPrefix(String name) {
|
||||
this.prefix = name;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (this.prefix != null) {
|
||||
super.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue