License: Artistic-2.0 CPAN Version kwalitee codecov Coverage Status Ask DeepWiki GH Actions: Linux Build GH Actions: Windows Build

Log-Any-Adapter-JSONLines

One-line JSON logging of arbitrary structured data in JSON Lines format.

SYNOPSIS

# Print to STDOUT:
use Log::Any::Adapter( 'JSONLines' );

# Print to a filehandle:
use Log::Any::Adapter( 'JSONLines', file => \*STDERR, );

# Print to a file, define logging level and JSON encoding, and
# sort JSON properties alphabetically:
use Log::Any::Adapter( 'JSONLines',
    file => 'out.json',
    log_level => 'fatal',
    encoding => 'UTF-8',
    canonical => 1,
);

# JSONLines uses hooks:
use Log::Any::Adapter ('JSONLines', hooks => {
  before => [ \&add_pid, ],
});
sub add_pid {
  my ($level, $category, $data) = @_;
  $data->{pid} = $$;
  return;
}

INSTALLATION

Packaging

Packaging status

LICENSE

This software is copyright (c) 2026 by Mikko Koivunalho mikkoi@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Terms of the Perl programming language system itself:

a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License"

The complete licenses are in the files LICENSE-Artistic-2.0 and LICENSE-GPL-3 within this repository. If these files are missing, they can be downloaded from the following urls:

* https://www.gnu.org/licenses/
* https://www.perlfoundation.org/artistic-license-20.html