Opened 22 months ago

Last modified 20 months ago

#2295 closed enhancement

Add API for extensions to send log messages that can be displayed by the web client — at Version 9

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.19.8
Component: web Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

Update The logging possibility can be useful for all types of extensions, not just service.


Services are extensions that are running in the background to perform some kind of regular service. They can be listed and accessed by the GUI at Administrate -> Services where it is possible to start and stop the services.

It would be useful (mostly for debugging purposes) to have a simple logging API that the services can use. It should be possible to view messages that are submitted to log in the web interface. The log doesn't have to be permanent but could be kept in memory with a limit on the number of messages to keep before older ones are removed.

Change History (9)

comment:1 by Nicklas Nordborg, 22 months ago

In 8116:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added ServiceLogger class and modified the ServiceControllerAction so that we can supply a logger from the BASE core. The logger currently only write to stdout and it deosn't know which extension it belongs to. This need to be fixed.

comment:2 by Nicklas Nordborg, 22 months ago

In 8117:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added a new render() method to the Renderer interface that provide information about the extension an action belongs to. A default implementation has been provided so existing implementation should still work.

Existing implementations in BASE have been updated to the new API.

comment:3 by Nicklas Nordborg, 22 months ago

In 8118:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added ServiceLog class which is intended to be the main class for keeping the log for a single extension.

comment:4 by Nicklas Nordborg, 22 months ago

In 8119:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added a web interface for viewing the log.

comment:5 by Nicklas Nordborg, 22 months ago

In 8120:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added a function for clearing the log.

comment:6 by Nicklas Nordborg, 22 months ago

In 8121:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added some more methods to the logging API to make it easier to use. It also possible to forward log messages to a SLF4J Logger implementation.

comment:7 by Nicklas Nordborg, 22 months ago

In 8122:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added the possibility to view the stacktrace for log entries that has one.

comment:8 by Nicklas Nordborg, 22 months ago

In 8123:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added a TRACE-level to log entries. They are never added to the log that is kept in memory, but can be written to standard output which can be enabled/disabled.

comment:9 by Nicklas Nordborg, 22 months ago

Description: modified (diff)
Summary: Add API for services to send log messages that can be displayed by the web clientAdd API for extensions to send log messages that can be displayed by the web client
Note: See TracTickets for help on using tickets.