refactor: xadmin and store logs

pull/5/head
Frédérik Benoist 2023-12-31 07:49:27 +01:00
parent 18e73d4700
commit 7649a507aa
3 changed files with 180 additions and 146 deletions

View File

@ -1,7 +1,7 @@
package com.example.services; package com.example.services;
import com.example.services.store.*; import com.example.services.store.*;
import com.example.services.xadmin.application.*; import com.example.services.xadmin.log.XadminLog;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
@ -19,10 +19,7 @@ import java.sql.DriverManager;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
@ -33,7 +30,7 @@ import org.slf4j.LoggerFactory;
@Path("/stores") @Path("/stores")
public class StoreService { public class StoreService {
private static final Logger logger = LoggerFactory.getLogger(DatabaseConnectDOTSOFT.class); private static final Logger logger = LoggerFactory.getLogger(StoreService.class);
private static List<Store> cachedStoreList; private static List<Store> cachedStoreList;
private static final Lock cacheLock = new ReentrantLock(); private static final Lock cacheLock = new ReentrantLock();
@ -227,7 +224,7 @@ public class StoreService {
try (DatabaseConnectXSTORE databaseConnection = new DatabaseConnectXSTORE(dbHost,"dtv")) { try (DatabaseConnectXSTORE databaseConnection = new DatabaseConnectXSTORE(dbHost,"dtv")) {
String query = "SELECT ORGANIZATION_ID, RTL_LOC_ID, WKSTN_ID, SEQUENCE_ID, SEQUENCE_MODE, SEQUENCE_NBR, CREATE_DATE, CREATE_USER_ID, UPDATE_DATE, UPDATE_USER_ID, RECORD_STATE " + String query = "SELECT ORGANIZATION_ID, RTL_LOC_ID, WKSTN_ID, SEQUENCE_ID, SEQUENCE_MODE, SEQUENCE_NBR, CREATE_DATE, CREATE_USER_ID, UPDATE_DATE, UPDATE_USER_ID, RECORD_STATE "+
"FROM DTV.COM_SEQUENCE " + "FROM DTV.COM_SEQUENCE " +
"WHERE organization_id = 1 " + "WHERE organization_id = 1 " +
"ORDER BY WKSTN_ID, SEQUENCE_ID"; "ORDER BY WKSTN_ID, SEQUENCE_ID";
@ -389,65 +386,26 @@ public class StoreService {
DriverManager.setLoginTimeout(5); // Set timeout to 5 seconds DriverManager.setLoginTimeout(5); // Set timeout to 5 seconds
try (DatabaseConnectXSTORE databaseConnection = new DatabaseConnectXSTORE(dbHost,"dtv")) { try (DatabaseConnectXSTORE databaseConnection = new DatabaseConnectXSTORE(dbHost,"dtv")) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); String query = "SELECT" +
java.util.Date startDate; " FROM_TZ(cel.CREATE_DATE, 'UTC') " +
Integer timezoneOffset = 0; " AT TIME ZONE " +
" CASE loc.COUNTRY " +
try { " WHEN 'CH' THEN 'Europe/Zurich' " +
startDate = formatter.parse(logDate); " WHEN 'NL' THEN 'Europe/Amsterdam' " +
Calendar cal = Calendar.getInstance(); " WHEN 'MC' THEN 'Europe/Monaco' " +
cal.setTime(startDate); " WHEN 'LU' THEN 'Europe/Luxembourg' " +
cal.add(Calendar.DATE, -9); " WHEN 'ES' THEN 'Europe/Madrid' " +
java.util.Date endDate = cal.getTime(); " WHEN 'FR' THEN 'Europe/Paris' " +
" WHEN 'US' THEN 'America/New_York' " +
String queryTZ = "SELECT timezone_offset " + " WHEN 'GB' THEN 'Europe/London' " +
"FROM (" + " WHEN 'BE' THEN 'Europe/Brussels' " +
" SELECT EXTRACT(HOUR FROM CAST(tt.BEGIN_DATETIME AS TIMESTAMP)) - EXTRACT(HOUR FROM CAST(tt.create_date AS TIMESTAMP)) AS timezone_offset " + " ELSE 'UTC' " +
" FROM dtv.trn_trans tt " + " END " +
" WHERE" + "AS CREATE_DATE, " +
" tt.ORGANIZATION_ID = 1" +
" AND tt.RTL_LOC_ID = ?" +
" AND tt.BUSINESS_DATE = TRUNC(?)" +
" AND tt.trans_TYPCODE = 'SYSTEM_OPEN'" +
" AND tt.TRANS_STATCODE = 'COMPLETE'" +
") " +
"WHERE ROWNUM = 1";
logger.info(queryTZ);
while (startDate.compareTo(endDate) >= 0) {
try (PreparedStatement pst = databaseConnection.getConnection().prepareStatement(queryTZ)) {
pst.setInt(1, storeId);
pst.setDate(2, new java.sql.Date(startDate.getTime()));
try (ResultSet rs = pst.executeQuery()) {
if (rs.next()) {
Integer tempTimezoneOffset = rs.getInt("timezone_offset");
if (tempTimezoneOffset != null) {
timezoneOffset = tempTimezoneOffset;
break;
}
}
}
}
cal.setTime(startDate);
cal.add(Calendar.DATE, -1);
startDate = (java.util.Date) cal.getTime();
}
} catch (ParseException e) {
e.printStackTrace();
}
// to prevent timezone offset from being too large
if (Math.abs(timezoneOffset) > 3) {
timezoneOffset = 0;
}
// WHERE cel.CREATE_DATE does not take time zone into account (...+ INTERVAL '1' HOUR * ?)
String query = "SELECT cel.CREATE_DATE + INTERVAL '1' HOUR * ? as CREATE_DATE, " +
"cel.CREATE_USER_ID, " + "cel.CREATE_USER_ID, " +
"cel.BUSINESS_DATE, " + "cel.BUSINESS_DATE, " +
"cel.RTL_LOC_ID, " + "cel.RTL_LOC_ID, "+
"cel.RTL_LOC_ID || ' - ' || loc.STORE_NAME AS STORE_NAME, " +
"cel.WKSTN_ID, " + "cel.WKSTN_ID, " +
"cel.LOG_LEVEL, " + "cel.LOG_LEVEL, " +
"cel.THREAD_NAME, " + "cel.THREAD_NAME, " +
@ -460,27 +418,50 @@ public class StoreService {
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.state.app.shutdown' THEN 'Xstore shutdown' " + " WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.state.app.shutdown' THEN 'Xstore shutdown' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.helpdesk.memory' THEN 'Application core' " + " WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.helpdesk.memory' THEN 'Application core' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.helpdesk' THEN 'Application core' " + " WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.helpdesk' THEN 'Application core' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.sysadmin.data.repqueue.errors' THEN 'Replication errors' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.sysadmin.data.repqueue.nofails' THEN 'Replication errors' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.hardware.init' THEN 'Hardware init' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.sensitive-data.logging' THEN 'Sensitive data logging' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.uncaught' THEN 'Uncaught exception' " +
"ELSE cel.LOGGER_CATEGORY END as LOGGER_CATEGORY " + "ELSE cel.LOGGER_CATEGORY END as LOGGER_CATEGORY " +
"FROM dtv.CTL_EVENT_LOG cel " + "FROM dtv.CTL_EVENT_LOG cel " +
"WHERE cel.CREATE_DATE BETWEEN TO_DATE( ?, 'rrrrmmdd') AND TO_DATE( ?, 'rrrrmmdd hh24:mi:ss') " + "JOIN dtv.LOC_RTL_LOC loc ON loc.RTL_LOC_ID = cel.RTL_LOC_ID " +
"WHERE cel.CREATE_DATE BETWEEN " +
"TO_TIMESTAMP(?, 'YYYYMMDD HH24:MI:SS') - INTERVAL '3' HOUR " +
"AND " +
"TO_TIMESTAMP(?, 'YYYYMMDD HH24:MI:SS') + INTERVAL '3' HOUR " +
"AND TO_CHAR(FROM_TZ(cel.CREATE_DATE, 'UTC') AT TIME ZONE " +
"CASE loc.COUNTRY " +
" WHEN 'CH' THEN 'Europe/Zurich' " +
" WHEN 'NL' THEN 'Europe/Amsterdam' " +
" WHEN 'MC' THEN 'Europe/Monaco' " +
" WHEN 'LU' THEN 'Europe/Luxembourg' " +
" WHEN 'ES' THEN 'Europe/Madrid' " +
" WHEN 'FR' THEN 'Europe/Paris' " +
" WHEN 'US' THEN 'America/New_York' " +
" WHEN 'GB' THEN 'Europe/London' " +
" WHEN 'BE' THEN 'Europe/Brussels' " +
" ELSE 'UTC' " +
"END, 'YYYYMMDD HH24:MI:SS') BETWEEN ? AND ? " +
"AND cel.ORGANIZATION_ID = 1 " + "AND cel.ORGANIZATION_ID = 1 " +
"AND cel.RTL_LOC_ID = ? " + "AND cel.RTL_LOC_ID = ? " +
"AND cel.THREAD_NAME IS NOT NULL " + "AND cel.THREAD_NAME IS NOT NULL " +
"ORDER BY cel.CREATE_DATE DESC"; "ORDER BY cel.CREATE_DATE DESC";
logger.info(query); logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) { try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
statement.setInt(1, timezoneOffset); statement.setString(1, logDate + " 00:00:00");
statement.setString(2, logDate); statement.setString(2, logDate + " 23:59:59");
statement.setString(3, logDate + " 23:59:59"); statement.setString(3, logDate + " 00:00:00");
statement.setInt(4, storeId); statement.setString(4, logDate + " 23:59:59");
statement.setInt(5, storeId);
ResultSet resultSet = statement.executeQuery(); ResultSet resultSet = statement.executeQuery();
List<XadminApplicationLog> storeLogList = new ArrayList<>(); List<XadminLog> storeLogList = new ArrayList<>();
while (resultSet.next()) { while (resultSet.next()) {
XadminApplicationLog storeLog = mapResultSetToStoreLog(resultSet); XadminLog storeLog = mapResultSetToStoreLog(resultSet);
storeLogList.add(storeLog); storeLogList.add(storeLog);
} }
@ -501,20 +482,21 @@ public class StoreService {
} }
} }
public XadminApplicationLog mapResultSetToStoreLog(ResultSet resultSet) throws SQLException { public XadminLog mapResultSetToStoreLog(ResultSet resultSet) throws SQLException {
XadminApplicationLog xadminapplicationlog = new XadminApplicationLog(); XadminLog xadminlog = new XadminLog();
xadminapplicationlog.setCreateDate(resultSet.getDate("CREATE_DATE")); xadminlog.setCreateDate(resultSet.getDate("CREATE_DATE"));
xadminapplicationlog.setCreateUserId(resultSet.getString("CREATE_USER_ID")); xadminlog.setCreateUserId(resultSet.getString("CREATE_USER_ID"));
xadminapplicationlog.setBusinessDate(resultSet.getDate("BUSINESS_DATE")); xadminlog.setBusinessDate(resultSet.getDate("BUSINESS_DATE"));
xadminapplicationlog.setRtlLocId(resultSet.getInt("RTL_LOC_ID")); xadminlog.setRtlLocId(resultSet.getInt("RTL_LOC_ID"));
xadminapplicationlog.setWkstnId(resultSet.getInt("WKSTN_ID")); xadminlog.setStoreName(resultSet.getString("STORE_NAME"));
xadminapplicationlog.setLogLevel(resultSet.getString("LOG_LEVEL")); xadminlog.setWkstnId(resultSet.getInt("WKSTN_ID"));
xadminapplicationlog.setThreadName(resultSet.getString("THREAD_NAME")); xadminlog.setLogLevel(resultSet.getString("LOG_LEVEL"));
xadminapplicationlog.setLogMessage(resultSet.getString("LOG_MESSAGE")); xadminlog.setThreadName(resultSet.getString("THREAD_NAME"));
xadminapplicationlog.setLoggerCategory(resultSet.getString("LOGGER_CATEGORY")); xadminlog.setLogMessage(resultSet.getString("LOG_MESSAGE"));
xadminlog.setLoggerCategory(resultSet.getString("LOGGER_CATEGORY"));
return xadminapplicationlog; return xadminlog;
} }
/** /**

View File

@ -1,10 +1,9 @@
package com.example.services; package com.example.services;
import com.example.services.xadmin.application.XadminApplicationLog; import com.example.services.xadmin.log.XadminLog;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
@ -17,8 +16,6 @@ import java.sql.DriverManager;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -30,72 +27,116 @@ public class XadminService {
private static final Logger logger = LoggerFactory.getLogger(DatabaseConnectXADMIN.class); private static final Logger logger = LoggerFactory.getLogger(DatabaseConnectXADMIN.class);
@GET @GET
@Path("/application/log/{storeId}") @Path("/log")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public Response getApplicationLogByStoreId(@PathParam("storeId") Integer storeId, public Response getLogByStoreId(@QueryParam("storeId") Integer storeId,
@QueryParam("WkstnId") Integer wkstnId, @QueryParam("wkstnId") Integer wkstnId,
@QueryParam("BeginDate") String beginDate, @QueryParam("beginDate") String beginDate,
@QueryParam("EndDate") String endDate, @QueryParam("endDate") String endDate,
@QueryParam("SearchText") String searchText) { @QueryParam("searchText") String searchText) {
if (storeId == null) {
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"storeId parameter is required\"}").build();
}
if (beginDate == null || endDate == null) { if (beginDate == null || endDate == null) {
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"BeginDate and EndDate parameters are required\"}").build(); return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"BeginDate and EndDate parameters are required\"}").build();
} }
DriverManager.setLoginTimeout(5); // Définir le timeout à 5 secondes DriverManager.setLoginTimeout(5); // Set timeout to 5 seconds
try (DatabaseConnectXADMIN databaseConnection = new DatabaseConnectXADMIN("dtv")) { try (DatabaseConnectXADMIN databaseConnection = new DatabaseConnectXADMIN("dtv")) {
String query = String query = "SELECT" +
"SELECT cel.BUSINESS_DATE, " + " FROM_TZ(cel.CREATE_DATE, 'UTC') " +
"cel.CREATE_DATE, " + " AT TIME ZONE " +
"cel.CREATE_USER_ID, " + " CASE loc.COUNTRY " +
"cel.RTL_LOC_ID, " + " WHEN 'CH' THEN 'Europe/Zurich' " +
"cel.WKSTN_ID, " + " WHEN 'NL' THEN 'Europe/Amsterdam' " +
"cel.LOG_LEVEL, " + " WHEN 'MC' THEN 'Europe/Monaco' " +
"cel.THREAD_NAME, " + " WHEN 'LU' THEN 'Europe/Luxembourg' " +
"cel.LOG_MESSAGE " + " WHEN 'ES' THEN 'Europe/Madrid' " +
"FROM dtv.CTL_EVENT_LOG cel " + " WHEN 'FR' THEN 'Europe/Paris' " +
"WHERE cel.CREATE_DATE BETWEEN ? AND TRUNC(? + 1) " + " WHEN 'US' THEN 'America/New_York' " +
"AND cel.ORGANIZATION_ID = 1 " + " WHEN 'GB' THEN 'Europe/London' " +
"AND cel.RTL_LOC_ID = ? " + " WHEN 'BE' THEN 'Europe/Brussels' " +
(wkstnId != null ? "AND cel.WKSTN_ID = ? " : "") + " ELSE 'UTC' " +
"ORDER BY cel.CREATE_DATE"; " END " +
"AS CREATE_DATE, " +
"cel.CREATE_USER_ID, " +
"cel.BUSINESS_DATE, " +
"cel.RTL_LOC_ID, " +
"cel.RTL_LOC_ID || ' - ' || loc.STORE_NAME AS STORE_NAME, " +
"cel.WKSTN_ID, " +
"cel.LOG_LEVEL, " +
"cel.THREAD_NAME, " +
"cel.LOG_MESSAGE, " +
"CASE WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.app.preflight' THEN 'Pre-flight error' " +
" WHEN cel.LOGGER_CATEGORY LIKE 'dtv.xstore.dataloader%' THEN 'DataLoader' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.sysadmin.data.failover' THEN 'Data-failover' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.order.download.offline' THEN 'Order error' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.state.app.startup' THEN 'Xstore startup' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.state.app.shutdown' THEN 'Xstore shutdown' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.helpdesk.memory' THEN 'Application core' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.helpdesk' THEN 'Application core' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.sysadmin.data.repqueue.errors' THEN 'Replication errors' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.sysadmin.data.repqueue.nofails' THEN 'Replication errors' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.hardware.init' THEN 'Hardware init' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.sensitive-data.logging' THEN 'Sensitive data logging' " +
" WHEN cel.LOGGER_CATEGORY = 'dtv.xstore.uncaught' THEN 'Uncaught exception' " +
"ELSE cel.LOGGER_CATEGORY END as LOGGER_CATEGORY " +
"FROM dtv.CTL_EVENT_LOG cel " +
"JOIN dtv.LOC_RTL_LOC loc ON loc.RTL_LOC_ID = cel.RTL_LOC_ID " +
"WHERE cel.CREATE_DATE BETWEEN " +
"TO_TIMESTAMP(?, 'YYYYMMDD HH24:MI:SS') - INTERVAL '3' HOUR " +
"AND " +
"TO_TIMESTAMP(?, 'YYYYMMDD HH24:MI:SS') + INTERVAL '3' HOUR " +
"AND TO_CHAR(FROM_TZ(cel.CREATE_DATE, 'UTC') AT TIME ZONE " +
"CASE loc.COUNTRY " +
" WHEN 'CH' THEN 'Europe/Zurich' " +
" WHEN 'NL' THEN 'Europe/Amsterdam' " +
" WHEN 'MC' THEN 'Europe/Monaco' " +
" WHEN 'LU' THEN 'Europe/Luxembourg' " +
" WHEN 'ES' THEN 'Europe/Madrid' " +
" WHEN 'FR' THEN 'Europe/Paris' " +
" WHEN 'US' THEN 'America/New_York' " +
" WHEN 'GB' THEN 'Europe/London' " +
" WHEN 'BE' THEN 'Europe/Brussels' " +
" ELSE 'UTC' " +
"END, 'YYYYMMDD HH24:MI:SS') BETWEEN ? AND ? " +
"AND cel.ORGANIZATION_ID = 1 " +
(storeId != null ? "AND cel.RTL_LOC_ID = ? " : "") +
(wkstnId != null ? "AND cel.WKSTN_ID = ? " : "") +
(searchText != null ? "AND LOWER(cel.LOG_MESSAGE) LIKE ? " : "") +
"AND cel.THREAD_NAME IS NOT NULL " +
"ORDER BY cel.CREATE_DATE DESC";
logger.info(query); logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) { try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); statement.setString(1, beginDate);
java.sql.Date parsedBeginDate = null; statement.setString(2, endDate + " 23:59:59");
java.sql.Date parsedEndDate = null; statement.setString(3, beginDate);
statement.setString(4, endDate + " 23:59:59");
try { Integer indexParam = 5;
parsedBeginDate = new java.sql.Date(format.parse(beginDate).getTime());
parsedEndDate = new java.sql.Date(format.parse(endDate).getTime()); if (storeId != null) {
} catch (ParseException e) { statement.setInt( indexParam++, storeId);
e.printStackTrace();
} }
statement.setDate(1, parsedBeginDate); if (wkstnId != null) {
statement.setDate(2, parsedEndDate); statement.setInt(indexParam++,wkstnId);
statement.setInt(3, storeId); }
if(wkstnId != null) { if(searchText != null) {
statement.setInt(4, wkstnId); statement.setString(indexParam++, "%" + searchText.toLowerCase() + "%");
} }
try (ResultSet resultSet = statement.executeQuery()) { try (ResultSet resultSet = statement.executeQuery()) {
List<XadminApplicationLog> xadminApplicationLogList = new ArrayList<>(); List<XadminLog> xadminLogList = new ArrayList<>();
while (resultSet.next()) { while (resultSet.next()) {
XadminApplicationLog xadminApplicationLog = mapResultSetToApplicationLog(resultSet); XadminLog xadminLog = mapResultSetToXadminLog(resultSet);
xadminApplicationLogList.add(xadminApplicationLog); xadminLogList.add(xadminLog);
} }
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String jsonResponse = objectMapper.writeValueAsString(xadminApplicationLogList); String jsonResponse = objectMapper.writeValueAsString(xadminLogList);
return Response.ok(jsonResponse).build(); return Response.ok(jsonResponse).build();
} }
@ -110,18 +151,20 @@ public class XadminService {
} }
} }
public XadminApplicationLog mapResultSetToApplicationLog(ResultSet resultSet) throws SQLException { public XadminLog mapResultSetToXadminLog(ResultSet resultSet) throws SQLException {
XadminApplicationLog xadminapplicationlog = new XadminApplicationLog(); XadminLog xadminlog = new XadminLog();
xadminapplicationlog.setBusinessDate(resultSet.getDate("BUSINESS_DATE")); xadminlog.setCreateDate(resultSet.getDate("CREATE_DATE"));
xadminapplicationlog.setCreateDate(resultSet.getDate("CREATE_DATE")); xadminlog.setCreateUserId(resultSet.getString("CREATE_USER_ID"));
xadminapplicationlog.setCreateUserId(resultSet.getString("CREATE_USER_ID")); xadminlog.setBusinessDate(resultSet.getDate("BUSINESS_DATE"));
xadminapplicationlog.setRtlLocId(resultSet.getInt("RTL_LOC_ID")); xadminlog.setRtlLocId(resultSet.getInt("RTL_LOC_ID"));
xadminapplicationlog.setWkstnId(resultSet.getInt("WKSTN_ID")); xadminlog.setStoreName(resultSet.getString("STORE_NAME"));
xadminapplicationlog.setLogLevel(resultSet.getString("LOG_LEVEL")); xadminlog.setWkstnId(resultSet.getInt("WKSTN_ID"));
xadminapplicationlog.setThreadName(resultSet.getString("THREAD_NAME")); xadminlog.setLogLevel(resultSet.getString("LOG_LEVEL"));
xadminapplicationlog.setLogMessage(resultSet.getString("LOG_MESSAGE")); xadminlog.setThreadName(resultSet.getString("THREAD_NAME"));
xadminlog.setLogMessage(resultSet.getString("LOG_MESSAGE"));
xadminlog.setLoggerCategory(resultSet.getString("LOGGER_CATEGORY"));
return xadminapplicationlog; return xadminlog;
} }
} }

View File

@ -1,8 +1,8 @@
package com.example.services.xadmin.application; package com.example.services.xadmin.log;
import java.util.Date; import java.util.Date;
public class XadminApplicationLog { public class XadminLog {
private Date businessDate; private Date businessDate;
private Date createDate; private Date createDate;
private String createUserId; private String createUserId;
@ -12,6 +12,7 @@ public class XadminApplicationLog {
private String threadName; private String threadName;
private String logMessage; private String logMessage;
private String loggerCategory; private String loggerCategory;
private String storeName;
public Date getBusinessDate() { public Date getBusinessDate() {
return businessDate; return businessDate;
@ -84,4 +85,12 @@ public class XadminApplicationLog {
public void setLoggerCategory(String loggerCategory) { public void setLoggerCategory(String loggerCategory) {
this.loggerCategory = loggerCategory; this.loggerCategory = loggerCategory;
} }
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
} }