Sha256: 7b62a4d1baaa25071b6e5f11164f6f0379b8667522fe1a9ab71337a0e306f4ee

Contents?: true

Size: 887 Bytes

Versions: 5

Compression:

Stored size: 887 Bytes

Contents

require 'soar_auditing_format'
require 'time'
require 'securerandom'
require "log4r_auditor"

class Main
  def test_sanity
    @iut = Log4rAuditor::Log4rAuditor.new
    @log4r_configuration = { 'file_name' => 'logfile',
                             'standard_stream' => 'stdout' }
    @iut.configure(@log4r_configuration)
    @iut.set_audit_level(:debug)

    my_optional_operation_field = SoarAuditingFormatter::Formatter.optional_field_format("operation", "Http.Get")
    my_optional_method_name_field = SoarAuditingFormatter::Formatter.optional_field_format("method", "#{self.class}::#{__method__}::#{__LINE__}")
    @iut.debug(SoarAuditingFormatter::Formatter.format(:debug,'my-sanity-service-id',SecureRandom.hex(32),Time.now.iso8601(3),"#{my_optional_method_name_field}#{my_optional_operation_field} test message with optional fields"))
  end
end

main = Main.new
main.test_sanity

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
log4r_auditor-1.1.0 sanity/sanity.rb
log4r_auditor-1.0.0 sanity/sanity.rb
log4r_auditor-0.0.4 sanity/sanity.rb
log4r_auditor-0.0.3 sanity/sanity.rb
log4r_auditor-0.0.2 sanity/sanity.rb