logger
logger copied to clipboard
how can i make the log file name as i want?
Please try to fill all questions below before submitting an issue.
- Android studio version:
- Android gradle plugin version:
- Logger version:
- Emulator/phone information:
- If possible, please add how did you initialize Logger?
- Is it flaky or does it happen all the time?
I need to make file name different. but I do not know how to change it.
@jerryzhj Take a look at com.orhanobut.logger.DiskLogStrategy.java
, the line: 52
said that you can't change the file name if you're using DiskLogStrategy.java
:
File logFile = getLogFile(folder, "logs");
If you want to change the file name your logs saved into, you can make a copy of DiskLogStrategy.java
, use the name you want and set this as your log strategy.
thx for all. I copy the DiskLogStrategy.java and addAdapter with it , then i custom it successfully. ` String diskPath = Environment.getExternalStorageDirectory().getAbsolutePath(); String folder = diskPath + File.separatorChar + "loggerR";
HandlerThread ht = new HandlerThread("AndroidFileLogger." + folder);`