* Got Log->entry() working now. Decided to use journald logging exclusively... They've thought a lot more about logging than we will, and the idea that there are special facilities for sensitive log entries and the ability to perform remote logging was too appealing.
* Created Log->level() to set/check the currently active log level.
* Created Log->secure() to set/check whether sensitive log entries will be recorded.
Signed-off-by: Digimer <digimer@alteeve.ca>
Thismethodwritesanentrytothelogfile,providedthelogfileisequaltoorhigherthantheactiveloglevel.Theexceptionisifthelogentrycontainssensitivedata,likeapassword,and'C<< log::secure >> is set to 'C<<0>>'(thedefault).
Thismethodwritesanentrytothejournaldlogs,providedthelogentry's level is equal to or higher than the active log level. The exception is if the log entry contains sensitive data, like a password, and 'C<<log::secure>>issetto'C<< 0 >>'(thedefault).
@ -96,7 +98,7 @@ In the above example, the log level is set to 'C<< 2 >>' and the 'C<< secure >>'
Finally,itispossibletologpre-processedstrings(asisdonein'Alert->warning()'and'Alert->error()').Inthiscase,the'C<< raw >>'parameterisusedanditcontainstheprocessedstring.Notethatthesourcefileandlinenumberarestillpre-pendedtotherawmessage.
Finally,itispossibletologpre-processedstrings(asisdonein'Alert->warning()'and'Alert->error()').Inthiscase,the'C<< raw >>'parameterisusedanditcontainstheprocessedstring.Notethatthesourcefileandlinenumberarestillpre-pendedtotherawmessage.
$an->Log->entry({
$an->Log->entry({
file=>$THIS_FILE,
source=>$THIS_FILE,
line=>__LINE__,
line=>__LINE__,
level=>2,
level=>2,
raw=>"This error can't be translated",
raw=>"This error can't be translated",
@ -106,9 +108,13 @@ The above should be used very sparingly, and generally only in places where stri
See'C<< man logger >>'forafulllistofvalidpriorities.
=head3key(required)
=head3key(required)
@ -116,6 +122,12 @@ NOTE: This is not required *if* 'C<< raw >>' is used instead.
Thisisthestringkeytouseforthelogentry.Bydefault,itwillbetranslatedintothe'C<< log::language >> language. If the string contains replacement variables, be sure to also use 'C<<variables>>'.
Thisisthestringkeytouseforthelogentry.Bydefault,itwillbetranslatedintothe'C<< log::language >> language. If the string contains replacement variables, be sure to also use 'C<<variables>>'.
Thisisthenumericloglevelofthislogentry.Itdeterminesifthemessageisofinteresttotheuser.Anentryisonlyrecordediftheuser's 'C<<log::level>>' is equal to or higher than this number. This is required, but if it is not passed, 'C<<2>>'willbeused.
Thisisthenumericloglevelofthislogentry.Itdeterminesifthemessageisofinteresttotheuser.Anentryisonlyrecordediftheuser's 'C<<log::level>>' is equal to or higher than this number. This is required, but if it is not passed, 'C<<2>>'willbeused.
@ -149,6 +161,20 @@ This is the highest log level, and it will generate a tremendous amount of log e
Whenset,thestringisprependedtothelogentry,after'C<< file >> if set, and should be set to C<< __LINE__ >>. It is used to show where in 'C<<file>>'thelogentrywasmadeandcanassistwithdebugging.
Whenset,thestringisprependedtothelogentry,after'C<< file >> if set, and should be set to C<< __LINE__ >>. It is used to show where in 'C<<file>>'thelogentrywasmadeandcanassistwithdebugging.