Retail:Log Clients
Clientside Logging
The system allows to save in the backend, the logs generated in the client side.
Also, it allows setup the level log displayed in the browser console, and the level log saved in backend.
The log traces are stored in the window "Log Client". The information stored is:
- Audit Info
- Message
- Device Id
- Level
- JSON
The "Device Id" is obtained by property "device idenfier" in OB.MobileApp.model.get('logConfiguration').
The JSON column is an array composed by the next information:
- Audit Info, Message, Device Id, Level, link, status(online/offline)
It is possible to add new information to the JSON array, adding functions to the Array: OB.MobileApp.model.get('logConfiguration')['logPropertiesExtension']. The functions should return an object.
For example, in POS Terminal, a function is added to know if the system is online or offline. This function returns:
"online: true/false"
There are 6 levels: Trace / Debug / Info / Warn / Error / Critical
The API consists in 7 functions:
- OB.trace(message)
- OB.debug(message)
- OB.info(message)
- OB.warn(message)
- OB.error(message)
- OB.critical(message)
- OB.log(level, message)
Three new preferences:
- Mobile Log Client Activate Log (Y/N): The logs will be saved or not in the backend (by default Y)
- Mobile Log Client Save Level (Trace/Debug/Info/Warn/Error/Critical): Level of logs saved in backend (by default Warn)
- Mobile Log Client Console Level (Trace/Debug/Info/Warn/Error/Critical): Level of logs displayed in console (by default Info)