caller_level => 1,
level => $level,
}, $code) };
- warn "could not deliver log event during Flog_$level: $@" if defined $@;
+ warn "could not deliver log event during Flog_$level: $@" if $@;
eval { carp $code->() };
- warn "could not emit warning during Flog_$level: $@" if defined $@;
+ warn "could not emit warning during Flog_$level: $@" if $@;
exit($exit_value);
});
}
my $format = $ENV{OBJECT_REMOTE_LOG_FORMAT};
my $selections = $ENV{OBJECT_REMOTE_LOG_SELECTIONS};
my %controller_should_log;
-
+
+ eval {
+ require Log::Any::Adapter;
+ require Object::Remote::Logging::LogAnyInjector;
+ Log::Any::Adapter->set('+Object::Remote::Logging::LogAnyInjector');
+ };
+
return unless defined $level;
$format = "[%l %r] %s" unless defined $format;
$selections = __PACKAGE__ unless defined $selections;
remote interpreter so all logs will be formated the same way.
This class is designed so any module can create their own logging sub-class using it.
-With out any additional configuration consumers of this logging class will automatically
-be enabled via OBJECT_REMOTE_LOG_LEVEL and formated with OBJECT_REMOTE_LOG_FORMAT but
-those additional log messages are not sent to STDERR. By setting the
-OBJECT_REMOTE_LOG_SELECTIONS environment variable to a list of class names seperated
-by spaces then logs generated by packages that use those classes will be sent to STDERR.
-This is also a configuration item that is forwarded to the remote interpreters so all
-logging is consistent.
+With out any additional configuration the consumers of this logging class will
+automatically be enabled via OBJECT_REMOTE_LOG_LEVEL and formated with
+OBJECT_REMOTE_LOG_FORMAT but those additional log messages are not sent to STDERR.
+By setting the OBJECT_REMOTE_LOG_SELECTIONS environment variable to a list of
+class names seperated by spaces then logs generated by packages that use those classes
+will be sent to STDERR. This is also a configuration item that is forwarded to the
+remote interpreters so all logging is consistent.
Regardless of OBJECT_REMOTE_LOG_LEVEL the logging system is still active and loggers
can access the stream of log messages to format and output them. Internally
OBJECT_REMOTE_LOG_LEVEL causes an L<Object::Remote::Logging::Logger> to be built
and connected to the L<Object::Remote::Logging::Router> instance. It is also possible
to manually build a logger instance and connect it to the router. See the documentation
-for the router and logger class.
+for the logger and router classes.
The logging system also supports a method of forwarding log messages from remote
interpreters to the local interpreter. Forwarded log messages are generated in the