Custom Logging & Plugins

All,

Today custom logging support was merged to Foreman develop [1]. This moves
Foreman from using the basic Rails logging to the logging rubygem [2]. You
will now see messages logged to either [app] or [sql] when viewing the log
messages. This also brings with it the ability for plugins to define and
use their own custom loggers and provide more insight into where calls or
messages are coming from when viewing the logs. Note that for plugins this
will not be automatic and require a conscious effort on plugin writers to
make use of the system. Please see the section on logging in the plugin
guide [3]. If you need real use examples, please take a look at this
Katello pull request [4] which migrates it's prior custom logging to this
new system.

Thanks,
Eric

[1] https://github.com/theforeman/foreman/pull/2376
[2] https://rubygems.org/gems/logging
[3]
How to Create a Plugin - Foreman
[4] https://github.com/Katello/katello/pull/5253

Great news! thanks

··· ----- Original Message ----- > All, > > Today custom logging support was merged to Foreman develop [1]. This moves > Foreman from using the basic Rails logging to the logging rubygem [2]. You > will now see messages logged to either [app] or [sql] when viewing the log > messages. This also brings with it the ability for plugins to define and > use their own custom loggers and provide more insight into where calls or > messages are coming from when viewing the logs. Note that for plugins this > will not be automatic and require a conscious effort on plugin writers to > make use of the system. Please see the section on logging in the plugin > guide [3]. If you need real use examples, please take a look at this > Katello pull request [4] which migrates it's prior custom logging to this > new system. > > > Thanks, > Eric > > > [1] https://github.com/theforeman/foreman/pull/2376 > [2] https://rubygems.org/gems/logging > [3] > http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Logging > [4] https://github.com/Katello/katello/pull/5253 > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

Would this new feature help me create a log file for the audits log in the
webUI that I could send to Splunk or LogStash?

··· On Thursday, June 4, 2015 at 10:36:44 AM UTC-4, Eric Helms wrote: > > All, > > Today custom logging support was merged to Foreman develop [1]. This moves > Foreman from using the basic Rails logging to the logging rubygem [2]. You > will now see messages logged to either [app] or [sql] when viewing the log > messages. This also brings with it the ability for plugins to define and > use their own custom loggers and provide more insight into where calls or > messages are coming from when viewing the logs. Note that for plugins this > will not be automatic and require a conscious effort on plugin writers to > make use of the system. Please see the section on logging in the plugin > guide [3]. If you need real use examples, please take a look at this > Katello pull request [4] which migrates it's prior custom logging to this > new system. > > > Thanks, > Eric > > > [1] https://github.com/theforeman/foreman/pull/2376 > [2] https://rubygems.org/gems/logging > [3] > http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin#Logging > [4] https://github.com/Katello/katello/pull/5253 >

Is there a way to silence inner postgres queries?
I ran rake db:migrate and got a lot of very detailed sql instead of just
the final query that was generated.
Adding min_messages: WARNING to my dayabase.yml didn't help.

··· On Fri, Jun 5, 2015 at 11:56 AM, Ivan Necas wrote:

Great news! thanks

----- Original Message -----

All,

Today custom logging support was merged to Foreman develop [1]. This
moves
Foreman from using the basic Rails logging to the logging rubygem [2].
You
will now see messages logged to either [app] or [sql] when viewing the
log
messages. This also brings with it the ability for plugins to define and
use their own custom loggers and provide more insight into where calls or
messages are coming from when viewing the logs. Note that for plugins
this
will not be automatic and require a conscious effort on plugin writers to
make use of the system. Please see the section on logging in the plugin
guide [3]. If you need real use examples, please take a look at this
Katello pull request [4] which migrates it’s prior custom logging to this
new system.

Thanks,
Eric

[1] https://github.com/theforeman/foreman/pull/2376
[2] https://rubygems.org/gems/logging
[3]

How to Create a Plugin - Foreman

[4] https://github.com/Katello/katello/pull/5253


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yes, it's a good starting point. We could now define a new audits
logger in the config file with a different log file, but we'd still need
a bit of code to make new audits be logged.

(A bit like


did.)

··· On 11/06/15 22:11, Christopher Pisano wrote: > Would this new feature help me create a log file for the audits log in > the webUI that I could send to Splunk or LogStash?


Dominic Cleal
Red Hat Engineering

> Is there a way to silence inner postgres queries?

+1

Another issue on my setup: After I deleted log/test.log file I see no
log output there anymore. With exception of migration logs. But nothing
else.

··· -- Later, Lukas #lzap Zapletal

> > Is there a way to silence inner postgres queries?
>
> +1
>

I don't know of a way to do this. Since we just tell ActiveRecord what
logger to use and let it handle everything else.

>
> Another issue on my setup: After I deleted log/test.log file I see no
> log output there anymore. With exception of migration logs. But nothing
> else.
>

This sounds like a potential bug.

Eric

··· On Thu, Jun 11, 2015 at 8:07 AM, Lukas Zapletal wrote:


Later,
Lukas #lzap Zapletal


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

> > Another issue on my setup: After I deleted log/test.log file I see no
> > log output there anymore. With exception of migration logs. But nothing
> > else.
> >
>
> This sounds like a potential bug.

Turns out it works well. But I would like to modify config/logging.yaml
myself. It is commited to git. Filed PR in this regard.

https://github.com/theforeman/foreman/pull/2449

··· -- Later, Lukas #lzap Zapletal

That doesn't really fix being able to customise it within a git
checkout, it just changes the config to your taste!

··· On 11/06/15 15:41, Lukas Zapletal wrote: >>> Another issue on my setup: After I deleted log/test.log file I see no >>> log output there anymore. With exception of migration logs. But nothing >>> else. >>> >> >> This sounds like a potential bug. > > Turns out it works well. But I would like to modify config/logging.yaml > myself. It is commited to git. Filed PR in this regard. > > https://github.com/theforeman/foreman/pull/2449


Dominic Cleal
Red Hat Engineering

> That doesn't really fix being able to customise it within a git
> checkout, it just changes the config to your taste!

It's a suggestion, we have discussed. I will redo the patch to be able
to load these from global settings file perhaps.

··· -- Later, Lukas #lzap Zapletal