Overview
Event log management is a crucial aspect of maintaining security and accountability in access control systems.
This guide will explore how to effectively manage event logs on Suprema devices using both the BioStar 2 Device SDK and Suprema G-SDK.
1. Event Log Overview
The SDK event codes are defined as follows. Please refer to the link below for more details.
https://github.com/supremainc/BioStar2_device_SDK/blob/master/Example_Cpp/Include/BSCommon/data/BS2Event.h
(The event_code.json file is included in the G-SDK sample code.)
If you need detailed information regarding logs, please refer to the official websites for each.
Device SDK: https://kb.supremainc.com/bs2sdk/doku.php?id=en:log_management_api
Suprema G-SDK: https://supremainc.github.io/g-sdk/api/event/
2. Managing Event Logs with BioStar 2 Device SDK
Part 1. API Call
BioStar 2 Device SDK and Suprema G-SDK provides a high-level interface for managing event logs across multiple devices from a centralized server.
[Retrieving Event Logs]
There are two main ways to receive logs from the device using the SDK:
- Requesting logs from the device.
Device SDK: https://kb.supremainc.com/bs2sdk/doku.php?id=en:bs2_getlog
Suprema G-SDK: https://supremainc.github.io/g-sdk/api/event/#getlog - Receiving real-time monitoring logs.
Device SDK: https://kb.supremainc.com/bs2sdk/doku.php?id=en:bs2_startmonitoringlog
Suprema G-SDK: https://supremainc.github.io/g-sdk/api/event/#enablemonitoring - Requesting filtered logs from the device.
[Deprecated] Article: [Both SDKs] Why has the Device Log Filtering API GetLogWithFilter Been Deprecated?
[Deleting Event Logs]
All logs on the device will be deleted. There is no API to delete logs partially.
Device SDK: https://kb.supremainc.com/bs2sdk/doku.php?id=en:bs2_clearlog
Suprema G-SDK: https://supremainc.github.io/g-sdk/api/event/#clearlog
Part 2. Event Log Structure
In this part, explain the common structure of the event logs.
1. ID
Log record ID which automatically increases from 1 when the log is generated.
- If you know the first and last logs, you can know how many logs are stored on the device.
[Check the initial logs stored on the device using the Device SDK]
As you can see in the photo, the logs prior to 2437 have been deleted.
There is no API to get the last log index(ID).
2. dateTime (Unix time format)
The time when the log has been generated. It means the seconds past from UTC until the current time.
3. deviceID
ID of the device that generated the log.
4. eventCode
The event code consists of a main code and a sub code.
The rest of data varies depending on the event type. Please refer to the SDK documentation for more details.
3. Tips for managing Event Logs
It is recommended that logs be received in bulk from the device using the GetLog API, and that logs occurring after the current time be received in real time using the EnableMonitoring and SubscribeRealtimeLog APIs, so that the server stores all logs in an appropriate DBMS and filters the logs from the DBMS.