log message library to support for multiple plugins

Provide to Administrators to be able to troubleshoot their configuration as close to the source of the transition as possible. It is not feasible for them to search through log messages on the system, and it’s even possible they do not have access to those files.

Providing the Log messages viewable as part of the UI.

Does any java api so that I can capture the log messages. so that I can store in the DB.

Using active objects I am able store the data into the DB but it should be current plugin.

I am looking for library to support for multiple plugins.

  1. Can I use one table store the multiple plugins log messages data?

  2. Can I integrate the AspectJ to implement for all the plugins ?

  3. Any atlassian api to support?

What I think about this -> Its wrong to store log into active objects just for troubleshooting.
As Jira logs are their for troubleshooting purposes. If user don’t have access to logs and they are asked to troubleshoot, its weird. (Sorry if the above comment sounds rude)
Now to answer your question -
1)Yes
2)I don’t know
3)I am not sure what you are looking for here.
Suggestion: You can create a service and expose to whole JIRA. And then can use that service in all other plugins to for logging. How to show them in front, just create a velocity template that brings in data from active objects and dumps it in front.

I am on the same page as @saurabh.gupta. I do not think it is the best design decision to store log information in active objects. Depending on how much your plugins are logging, the log level and the load of the system you will end up having a mass amount of data to handle. Additionally, you have to take care of all the maintanace´, lie jobs for log purging and so on.

About your first question: The Admin himself would be able to change the logging overall, replacing the file appender in the log settings of his system, with a database appender. If you want to do it in your plugins themselves, it is possible, but not that easy. AO tables are kind of “sandboxed”, which means plugin B is not able to access the tables from plugin A directly over AO. You would have to make one plugin to the master and provide a service to write to the db log, so other plugins could use it. Alternativ, you could try to access the DB directly, without AO, which is not recommended.

A much easier way to solve at least one part for your original problem would be to use plugins, which are already available on the marketplace, like:

1 Like

@alexander.kueken Thanks for suggestion.

I am planning to write one plugin as master and provide the service to write the db log, so that other plugins can use it.
question: Can I expose that service as public to use it in other plugins? I think I can use this plugin as dependency in other plugins so that I can use the service.

Other above questions:
the log level is configurable and for maintenance yes we are doing 90days purging this is also configurable.

I hope this is fine. let me know still any inputs missing here.