IDEMPIERE-2951 Delete all Trace Logs from Monitor should not delete AuthFailure.log
This commit is contained in:
parent
a8536f15af
commit
34926b0409
|
@ -35,13 +35,14 @@ public class LogAuthFailure {
|
||||||
|
|
||||||
private static FileOutputStream file = null;
|
private static FileOutputStream file = null;
|
||||||
private static Writer writer;
|
private static Writer writer;
|
||||||
|
public static String authFailureFilename = "AuthFailure.log";
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static CLogger log = CLogger.getCLogger(LogAuthFailure.class);
|
private static CLogger log = CLogger.getCLogger(LogAuthFailure.class);
|
||||||
|
|
||||||
public LogAuthFailure() {
|
public LogAuthFailure() {
|
||||||
|
|
||||||
String path = Ini.getAdempiereHome() + File.separator + "log";
|
String path = Ini.getAdempiereHome() + File.separator + "log";
|
||||||
String name = path + File.separator + "AuthFailure.log";
|
String name = path + File.separator + authFailureFilename;
|
||||||
File fileName;
|
File fileName;
|
||||||
try {
|
try {
|
||||||
fileName = new File(name);
|
fileName = new File(name);
|
||||||
|
|
|
@ -39,6 +39,7 @@ import javax.servlet.http.HttpServlet;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.adempiere.util.LogAuthFailure;
|
||||||
import org.apache.ecs.HtmlColor;
|
import org.apache.ecs.HtmlColor;
|
||||||
import org.apache.ecs.xhtml.a;
|
import org.apache.ecs.xhtml.a;
|
||||||
import org.apache.ecs.xhtml.b;
|
import org.apache.ecs.xhtml.b;
|
||||||
|
@ -382,6 +383,8 @@ public class AdempiereMonitor extends HttpServlet
|
||||||
String fileName = logs[i].getAbsolutePath();
|
String fileName = logs[i].getAbsolutePath();
|
||||||
if (fileName.equals(fileHandler.getFileName()))
|
if (fileName.equals(fileHandler.getFileName()))
|
||||||
continue;
|
continue;
|
||||||
|
if (fileName.endsWith(LogAuthFailure.authFailureFilename)) // Do not delete login failure
|
||||||
|
continue;
|
||||||
if (logs[i].delete())
|
if (logs[i].delete())
|
||||||
log.warning("Deleted: " + fileName);
|
log.warning("Deleted: " + fileName);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue