Skip to content

Logs the start and end of a job by subscribing to the SPS topic log.

Notifications You must be signed in to change notification settings

jrobertson/job_log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introducing the job_log gem

Usage

require 'job_log'

jl = JobLog.new
jl.listen

The job_log gem subscribes to the following topics:

  • log/+/started/+
  • log/+/done/+
  • log/+/aborted/+

Entries are save into the the Dynarex file job_log.xml.

Testing

require 'spspub_log'

sps = SPSPubLog.new host: 'sps2', port: 59100
sps.info 'frt/started: Fetches the remaining bank balance. #bank #balance'

sleep 3

sps.info 'frt/done: bye'

Output

file: job_log.xml

<?xml version='1.0' encoding='UTF-8'?>
<jobs>
  <summary>
    <recordx_type>dynarex</recordx_type>
    <format_mask>[!title] [!desc] [!started] [!ended] [!status] [!tags]</format_mask>
    <schema>jobs/job(title, desc, started, ended, status, tags)</schema>
    <default_key>title</default_key>
  </summary>
  <records>
    <job id='1' created='2017-10-30 11:39:34 +0000' last_modified='2017-10-30 11:39:37 +0000'>
      <title>frt</title>
      <desc>Fetches the remaining bank balance.</desc>
      <started>2017-10-30 11:39:34 +0000</started>
      <ended>2017-10-30 11:39:37 +0000</ended>
      <status>success</status>
      <tags>bank balance</tags>
    </job>
  </records>
</jobs>

Resources

joblog job_log gem job log spspublog sps

About

Logs the start and end of a job by subscribing to the SPS topic log.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages