Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Community discussion is present here: http://community.pbspro.org/t/pp-838-support-for-logging-via-syslog-in-pbs/591

...

  facility = //PBS_SYSLOG from pbs.conf

  severity = //  PBS_SYSLOGSEVR from pbs.conf (by default NONE)

Methods:

    def get_log_type(syslog=None)

       Summary: logic for which messages to read (local logs / syslog)

...

      syslog - by default falseNone

      Description: 

      1) read from PBS.conf  - PBS_SYSLOG & PBS_LOCALLOG.

...

       b) If PBS_SYSLOG is not set, we will locally in code set variable PBS_SYSLOG=0

       c) If  PBS_LOCALLOG is not set, we will locally in code set variable PBS_LOCALLOG=1

      Therefore this will check into the local logs only if values are not set (see line 3 in below table)


      2) Logic for whether to read local logs/ syslog we will follow this table -

...

     


PBS_SYSLOG  

PBS_LOCALLOG  

Syslog_attribute 

Which log to check in log_match() 

Return Value for the log_match()

0 

false

Throw error


0 

true

Throw error 


1 

false

Local_Log 

local_log(x,y) 

0

1 

true

Throw error 


set 

0 

false

Syslog 

syslog(x,y)

set 

0 

true

Syslog 

syslog(x,y)

set 

1 

falseMatch in both logs 

Local_log

local_log(x,y)

set 

1 

true

Syslog 

syslog(x,y)
set 1NoneMatch in both logs local_log(x,y)














 


       Note: In row 7 where we have to match in both syslog and local log, we would have to call _log_match() twice. 

...

      Note:  The error thrown will be PtlLogMatchError

     

       Return:      

      self.file_to_check (/ / file_to_check =1 for syslog, file_to_check=2 for local logs  and file_to_check=3 for both)

...

class PBSService(PBSObject)

   def log_match(syslog=FalseNone)

       // Additions: 

       syslog: If the user wants to read into syslog file? By default false

...

      Description:

        1) if attribute syslog = true, enable syslog parameter in pbs.conf and disable PBS_LOCALOG. Set x = 1.Skip step 2 and go to step 3 below.       2) if syslog = false run PBSSyslogUtils.get_log_type() to check if local logs/ syslog is to be checked

          x= PBSSyslogUtils.get_log_type(syslog=syslog)

       3 2) if x =1 or 3 -  read _log_match(syslog=true)

      43) if x = 2 or 3 -  read _log_match(syslog=false)

      54) if 3 and 4 pass return the value

...