Back to project page CopresenceDataCollector.
The source code is released under:
Copyright (c) 2014, Xiang Gao All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Re...
If you think the Android project CopresenceDataCollector listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.sesy.coco.datacollector.log; // w ww. j a v a2 s . c om import org.apache.log4j.Level; import org.sesy.coco.datacollector.file.FileHelper; import android.content.Context; import android.provider.Settings.Secure; import de.mindpipe.android.logging.log4j.LogConfigurator; public class ConfigureLog4J { public static void configure(Context context) { FileHelper fh = new FileHelper(context); String root = fh.getDir(); String uuid = Secure.getString(context.getContentResolver(),Secure.ANDROID_ID); final LogConfigurator logConfigurator = new LogConfigurator(); String furi = root + "/" +"dclog_"+ uuid + ".txt"; logConfigurator.setFileName(furi); logConfigurator.setRootLevel(Level.DEBUG); logConfigurator.setLevel("org.apache", Level.DEBUG); logConfigurator.setUseFileAppender(true); logConfigurator.setFilePattern("%d %-5p [%c{2}]-[%L] %m%n"); logConfigurator.setMaxFileSize(1024 * 1024 * 2); logConfigurator.setImmediateFlush(true); logConfigurator.configure(); } }