/** * * 获取apache日志,b2b用script方式,淘宝用ssh方式 如果淘宝需要支持script,日志路径需要支持可配置 * * @param mode * @param ip * @return */ public static String getApacheFetchCommand(AutoLoadMode mode, String ip) { String command = null; if (mode == AutoLoadMode.SSH) { command = "tail -f /home/admin/cai/logs/cronolog/" + TimeConvertUtil.formatCurrentDate("yyyy/MM/yyyy-MM-dd-") + "taobao-access_log"; } if (mode == AutoLoadMode.SCRIPT) { Calendar calendar = Calendar.getInstance(); int index = calendar.get(Calendar.DAY_OF_WEEK) - 1; command = "http://" + ip + ":8082/" + "tail/home/admin/output/logs/cookie_logs/" + index + "/cookie_log?" + getTaskId() + "&encode=text"; } return command; }
/** * * 获取tomcat信息,b2b暂时不取这些信息 * * @param mode * @param ip * @return */ public static String getTomcatFetchCommand(AutoLoadMode mode, String ip) { String command = null; if (mode == AutoLoadMode.SSH) { command = "tail -f /home/admin/logs/tomcataccess/localhost_access_log." + TimeConvertUtil.formatCurrentDate("yyyy-MM-dd") + ".log"; } if (mode == AutoLoadMode.SCRIPT) { command = "http://" + ip + ":8082/" + "tail/home/admin/logs/tomcataccess/localhost_access_log." + TimeConvertUtil.formatCurrentDate("yyyy-MM-dd") + ".log?" + getTaskId() + "&encode=text"; } return command; }