[Java] Change log dir to /tmp/raylogs (#2677)

Currently, log directory in Java is a relative path . This PR changes it to `/tmp/raylogs` (with the same format as Python, e.g., `local_scheduler-2018-51-17_17-8-6-05164.err`). It also cleans up some relative code.
This commit is contained in:
Hao Chen
2018-08-19 14:46:36 +08:00
committed by Robert Nishihara
parent e56eb354eb
commit 78b6bfb7f9
8 changed files with 101 additions and 191 deletions
@@ -22,14 +22,13 @@ public class RayLog {
public static Logger rapp;
/**
* it must be called before using Ray loggers,
* or the dynamic update does not work.
* @param workingDir store the logs under params.working_directory
* Initialize loggers
* @param logDir directory of the log files.
*/
public static void init(String workingDir) {
public static void init(String logDir) {
String loggingPath = System.getProperty("logging.path");
if (loggingPath == null) {
System.setProperty("logging.path", workingDir + "/logs");
System.setProperty("logging.path", logDir);
}
String loggingFileName = System.getProperty("logging.file.name");
if (loggingFileName != null && loggingFileName.contains("*pid_suffix*")) {