Opened 7 months ago

Closed 5 months ago

#2295 closed enhancement (fixed)

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

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 (17)

comment:1 Changed 7 months ago by Nicklas Nordborg

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 Changed 7 months ago by Nicklas Nordborg

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 Changed 7 months ago by Nicklas Nordborg

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 Changed 7 months ago by Nicklas Nordborg

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 Changed 7 months ago by Nicklas Nordborg

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 Changed 7 months ago by Nicklas Nordborg

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 Changed 7 months ago by Nicklas Nordborg

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 Changed 7 months ago by Nicklas Nordborg

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 Changed 7 months ago by Nicklas Nordborg

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

comment:10 Changed 7 months ago by Nicklas Nordborg

In 8124:

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

Started with refactoring by moving the logging code into the BASEcore package.

comment:11 Changed 7 months ago by Nicklas Nordborg

In 8125:

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

Renamed classes Service* -> Extensions* and extract inner classes to separate files.

comment:12 Changed 7 months ago by Nicklas Nordborg

In 8126:

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

Renaming warning() to warn() to make the implementation more like the SLF4J implementation.

comment:13 Changed 7 months ago by Nicklas Nordborg

In 8127:

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

Reverted the ServiceControllerAction to the original API. Services that need a logger should call ExtensionsLog.createLogger().

comment:14 Changed 7 months ago by Nicklas Nordborg

In 8128:

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

Moved the "View log" page to the extensions administration page.

comment:15 Changed 7 months ago by Nicklas Nordborg

In 8129:

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

Added an "Update" button to the "View log" dialog.

comment:16 Changed 6 months ago by Nicklas Nordborg

In 8135:

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

Stacktraces should only wrap at predefined locations.

comment:17 Changed 5 months ago by Nicklas Nordborg

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.