remove log4j Framework and switch to java util logger
This commit is contained in:
parent
ab353d24f6
commit
e9c35d2e3f
3 changed files with 21 additions and 4 deletions
|
@ -11,7 +11,6 @@ def jdaVersion = '4.4.0_350'
|
|||
def jsonsimpleVersion = '1.1.1'
|
||||
def jodatimeVersion = '2.10.13'
|
||||
def self4JVersion = '1.7.32'
|
||||
def log4jVersion = '2.15.0'
|
||||
def JSON = '4.13.0'
|
||||
|
||||
mainClassName = 'MissingIDent'
|
||||
|
@ -31,8 +30,7 @@ dependencies {
|
|||
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: jsonsimpleVersion
|
||||
compile group: 'joda-time', name: 'joda-time', version: jodatimeVersion
|
||||
compile group: 'org.slf4j', name: 'slf4j-api', version: self4JVersion
|
||||
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: self4JVersion
|
||||
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4jVersion
|
||||
compile group: 'org.slf4j', name: 'slf4j-jdk14', version: self4JVersion
|
||||
compile group: 'com.cedarsoftware', name: 'json-io', version: JSON
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import Controll.Controller;
|
||||
import net.dv8tion.jda.api.AccountType;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.JDABuilder;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
|
@ -11,6 +10,8 @@ import org.json.simple.JSONObject;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.logging.LogManager;
|
||||
|
||||
/**
|
||||
* @author https://www.Hiajen.de
|
||||
*/
|
||||
|
@ -23,6 +24,9 @@ public class MissingIDent {
|
|||
***************************************/
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
LogManager loggerMG = java.util.logging.LogManager.getLogManager();
|
||||
loggerMG.readConfiguration(MissingIDent.class.getClassLoader().getResourceAsStream("logging.properties"));
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(MissingIDent.class);
|
||||
|
||||
logger.info("Bot Started");
|
||||
|
|
15
src/main/resources/logging.properties
Normal file
15
src/main/resources/logging.properties
Normal file
|
@ -0,0 +1,15 @@
|
|||
handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler
|
||||
|
||||
java.util.logging.FileHandler.level=ALL
|
||||
java.util.logging.FileHandler.limit=10485760
|
||||
java.util.logging.FileHandler.count=2
|
||||
java.util.logging.FileHandler.append=true
|
||||
java.util.logging.FileHandler.pattern=MissingIdent%g.log
|
||||
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
|
||||
|
||||
java.util.logging.ConsoleHandler.level=ALL
|
||||
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
|
||||
|
||||
java.util.logging.SimpleFormatter.format=[%1$TF-%1$TT][%2$s][%4$s] : %5$s %6$s %n
|
||||
|
||||
net.dv8tion.jda.level=WARNING
|
Loading…
Reference in a new issue