-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding support for Pega CloudK log pattern
- Loading branch information
Showing
16 changed files
with
1,340 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/com/pega/gcs/logviewer/model/JsonLogEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
package com.pega.gcs.logviewer.model; | ||
|
||
import java.awt.Color; | ||
import java.util.ArrayList; | ||
|
||
import javax.swing.JPanel; | ||
|
||
import com.pega.gcs.logviewer.LogTableModel; | ||
|
||
public class JsonLogEntry extends LogEntry { | ||
|
||
private static final long serialVersionUID = -2296850212910350176L; | ||
|
||
public JsonLogEntry(LogEntryKey logEntryKey, ArrayList<String> logEntryValueList, String logEntryText) { | ||
|
||
super(logEntryKey, logEntryValueList, logEntryText); | ||
|
||
} | ||
|
||
@Override | ||
public Color getForegroundColor() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public Color getBackgroundColor() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public JPanel getDetailsPanel(LogTableModel logTableModel) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
} |
96 changes: 96 additions & 0 deletions
96
src/main/java/com/pega/gcs/logviewer/model/JsonLogEntryModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
package com.pega.gcs.logviewer.model; | ||
|
||
import java.nio.charset.Charset; | ||
import java.time.ZoneId; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Locale; | ||
import java.util.Map; | ||
import java.util.Set; | ||
import java.util.TreeMap; | ||
|
||
import com.pega.gcs.fringecommon.log4j2.Log4j2Helper; | ||
import com.pega.gcs.logviewer.LogViewerUtil; | ||
|
||
public class JsonLogEntryModel extends LogEntryModel { | ||
|
||
private static final Log4j2Helper LOG = new Log4j2Helper(JsonLogEntryModel.class); | ||
|
||
public JsonLogEntryModel(DateTimeFormatter modelDateTimeFormatter, ZoneId modelZoneId, ZoneId displayZoneId) { | ||
super(modelDateTimeFormatter, modelZoneId, displayZoneId); | ||
} | ||
|
||
@Override | ||
public void rebuildLogTimeSeriesCollectionSet(Locale locale) throws Exception { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
public Set<LogSeriesCollection> getLogTimeSeriesCollectionSet(boolean filtered, Locale locale) throws Exception { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public Set<LogIntervalMarker> getLogIntervalMarkerSet() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public LogEntryColumn[] getReportTableColumns() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getTypeName() { | ||
return "JSON"; | ||
} | ||
|
||
@Override | ||
protected void postProcess(LogEntry logEntry, ArrayList<String> logEntryValueList, Charset charset, Locale locale) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
public void addLogEntry(int logEntryIndex, Map<String, String> fieldMap, String logEntryText) { | ||
|
||
List<LogEntryColumn> logEntryColumnList = getLogEntryColumnList(); | ||
DateTimeFormatter modelDateTimeFormatter = getModelDateTimeFormatter(); | ||
ZoneId modelZoneId = getModelZoneId(); | ||
|
||
ArrayList<String> columnValueList = new ArrayList<String>(); | ||
|
||
columnValueList.add(String.valueOf(logEntryIndex)); | ||
|
||
String timestampStr = null; | ||
|
||
for (LogEntryColumn logEntryColumn : logEntryColumnList) { | ||
|
||
String columnId = logEntryColumn.getColumnId(); | ||
String columnValue = fieldMap.get(columnId); | ||
columnValueList.add(columnValue); | ||
|
||
if (logEntryColumn.equals(LogEntryColumn.TIMESTAMP)) { | ||
timestampStr = columnValue; | ||
} | ||
} | ||
|
||
try { | ||
|
||
long logEntryTime = LogViewerUtil.getTimeMillis(timestampStr, modelDateTimeFormatter, modelZoneId); | ||
|
||
LogEntryKey logEntryKey = new LogEntryKey(logEntryIndex, logEntryTime); | ||
|
||
JsonLogEntry jsonLogEntry = new JsonLogEntry(logEntryKey, columnValueList, logEntryText); | ||
|
||
} catch (Exception e) { | ||
LOG.error(e); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.