[dancer-users] transfer log object
arjan at unitedknowledge.nl
Tue Aug 25 02:31:57 BST 2015
On 24-08-15 03:27, Andrew Beverley wrote:
> On Sun, 2015-08-23 at 20:17 -0400, Arjan Widlak wrote:
>>> You don't need to access the log object. In your other object you just do (for
>>> use Log::Report;
>>> trace "This will be logged as a debug string";
>>> warning "This will be logged as a warning";
>>> The above lines will be logged in exactly the same way as any other logging in
>>> your Dancer2 application, as long as you're using the
>>> Dancer2::Logger::LogReport logging backend.
>> I can imagine how this works, within a Dancer2 application. But I'm
>> talking about a class that doesn't have a "use Dancer2" statement. Or
>> are you saying: just have both applications use Log::Report and
>> configure them to log to the same file?
> You don't need to do anything in your other object, other than "use Log::Report".
> As long as your object was called from within your Dancer2 application (which it
> was in your original example), then everything else will Just Work. You don't need
> to configure any separate logging; it will use what is already configured in your
> parent application.
> If it is literally a separate application, executed complete separately from
> within the OS, then yes, you would need to configure it twice.
Clear and thanks. I'm going to configure and instantiate it - or
Dancers2 log object - twice then, because in the other application I
want to be able to either use Dancer's or it's own.
Thank you for your efforts!
> dancer-users mailing list
> dancer-users at dancer.pm
More information about the dancer-users