mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
System/Log Files - add "Service Log (this boot)" including parser as an option to provide access to entries collected in https://github.com/opnsense/core/issues/6099 (proposal for 23.1)
This commit is contained in:
parent
20b25258ff
commit
6f46fe3080
@ -95,6 +95,7 @@
|
||||
<Backend url="/ui/diagnostics/log/core/configd"/>
|
||||
<General url="/ui/diagnostics/log/core/system"/>
|
||||
<WebGUI VisibleName="Web GUI" url="/ui/diagnostics/log/core/lighttpd"/>
|
||||
<ServiceLog VisibleName="Service Log (this boot)" url="/ui/diagnostics/log/core/boot"/>
|
||||
</LogFiles>
|
||||
<Diagnostics order="160" cssClass="fa fa-medkit fa-fw">
|
||||
<Services url="/status_services.php">
|
||||
|
||||
@ -61,6 +61,23 @@ class SysLogFormat(NewBaseLogFormat):
|
||||
return response[:tmp].strip().split()[-1] if tmp > -1 else ""
|
||||
|
||||
|
||||
class ServiceLogFormat(NewBaseLogFormat):
|
||||
def __init__(self, filename):
|
||||
super(ServiceLogFormat, self).__init__(filename)
|
||||
|
||||
@staticmethod
|
||||
def match(line):
|
||||
return len(line) > 25 and line[19] == '+' and re.match(r'\d{4}(.\d{2}){2}(\s|T)(\d{2}.){2}\d{2}', line[0:19])
|
||||
|
||||
@property
|
||||
def timestamp(self):
|
||||
return self._line[0:19]
|
||||
|
||||
@property
|
||||
def line(self):
|
||||
return self._line[26:]
|
||||
|
||||
|
||||
class SysLogFormatEpoch(NewBaseLogFormat):
|
||||
def __init__(self, filename):
|
||||
super(SysLogFormatEpoch, self).__init__(filename)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user