Hi Gerrit, While I like the idea of logging to the system log, I think there are several points which I'd like to mention.
First one is logging in the framework itself. Currently there is some output to standard out, but probably also some missing parts. To be able to do something with these entries the framework needs to be updated to use the LogService (if present). This is a bug/improvement of the Celix could and should be done (imo). Second one: The LogService is based on the Compendium spec, and already supports the Log Writer construction. More specifically, it is possible to register a LogListener to the LogReaderService. See chapter 101 of the compendium spec, and the LogWriter of Celix. So making a component which takes log entries and adds them to the system log can already be written. Third one: you ask for easy filtering between Celix and Application logging. The OSGi API for the log service does not have any explicit support for this, eg there is no log category or similar which can be used. However, log entries can have a reference to the bundle that made the log. But maybe it is easier to handle such filtering in your own specific syslog output component.. Regarding the properties: The log service itself doesn't have any properties defined in the spec. But looking at Felix it probably makes sense to have some to specify the maximum number of messages to keep in memory and to specify wether debug messages should be stored. These properties only influence the storage of entries, and has nothing to do with subscribed listeners, so even if debug messages are not stored they are still send to the listeners. All other properties can be handled in the specific listener implementation. In other words, the LogService is only meant for creating log entries. With the ReaderService and Listeners it is possible to process those logs in a specific way best suited for the actual user. So while I do think it is interesting for Celix to have a syslog writer, I am not sure if the specific request for filtering will fit in a generic solution. It might be better to implement this writer for your specific use case. A good example of a listener is the LogWriter bundle which writes to standard out. 2013/10/1 Gerrit Binnenmars (JIRA) <[email protected]> > Gerrit Binnenmars created CELIX-87: > -------------------------------------- > > Summary: Log writer to syslog > Key: CELIX-87 > URL: https://issues.apache.org/jira/browse/CELIX-87 > Project: Celix > Issue Type: New Feature > Affects Versions: 0.0.2-incubating > Environment: Linux system > Reporter: Gerrit Binnenmars > > > We would like to have the internal Celix logging in the Linux syslog > output mechanism. > Also bundles need to be able to register their own logWriter (in the > syslog output it shall be easy to filter between Celix logging and > application logging) > Configurable shall be: output file name (default: /var/log/messages) > Level (to enable/disable logging at different levels) > Special text that can be used for filtering > > > > > -- > This message was sent by Atlassian JIRA > (v6.1#6144) > -- Met vriendelijke groet, Alexander Broekhuis
