Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added config file for anything using java.util.logging (closes #30)

  • Loading branch information...
commit 5a660531db1175f7089ce8e5a67bda87ddc4ef4c 1 parent c8eba76
@rodnaph authored
View
1  dist-files/log/javalogging.properties
@@ -0,0 +1 @@
+org.jaudiotagger.level=WARNING
View
22 src/com/pugh/sockso/Main.java
@@ -37,7 +37,9 @@
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
+import java.io.FileInputStream;
import java.io.InputStreamReader;
+import java.io.InputStream;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
@@ -45,6 +47,8 @@
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
+import java.util.logging.LogManager;
+
public class Main {
private static final Logger log = Logger.getLogger( Main.class );
@@ -74,6 +78,7 @@ public static void main( final String[] args ) throws Exception{
Runtime.getRuntime().addShutdownHook( new Shutdown() );
initLogger( getLogPropsFile("default") );
+ initJavaLogger();
//
// do initial setup, we're gonna need to parse the command line
@@ -631,5 +636,22 @@ private static void initLogger( final String propsFile ) {
PropertyConfigurator.configure( propsFile );
}
+
+ /**
+ * Inits loggers using java.util.logging
+ *
+ */
+
+ private static void initJavaLogger() throws IOException {
+ final String propsFile = "log/javalogging.properties";
+ final InputStream is = new FileInputStream( new File(propsFile) );
+
+ LogManager.getLogManager()
+ .readConfiguration( is );
+
+ Utils.close( is );
+
+ }
+
}

1 comment on commit 5a66053

@rgngl

great, thanks.

Please sign in to comment.
Something went wrong with that request. Please try again.