Shift4_ExternalISV_CloudLogging 1.0.0.2

Install-Package Shift4_ExternalISV_CloudLogging -Version 1.0.0.2
dotnet add package Shift4_ExternalISV_CloudLogging --version 1.0.0.2
<PackageReference Include="Shift4_ExternalISV_CloudLogging" Version="1.0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Shift4_ExternalISV_CloudLogging --version 1.0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Shift4_ExternalISV_CloudLogging, 1.0.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Shift4_ExternalISV_CloudLogging as a Cake Addin
#addin nuget:?package=Shift4_ExternalISV_CloudLogging&version=1.0.0.2

// Install Shift4_ExternalISV_CloudLogging as a Cake Tool
#tool nuget:?package=Shift4_ExternalISV_CloudLogging&version=1.0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Shift4 will provide aws credentials Shift4 will provide the region Shift4 will provide the loggroup

The locationIdentifier should be something unique to the site, and the instance of the application.
The location identifier must use regexpression conforming string Colons are not allowed. Asterisks are not allowed. Please keep locationIdentifiers under 100 characters, as the Cloudwatch logstream generated from this is limited to 512 characters.

For pc's that have one instance running a mac address could suffice For pc's that have more then one instance a mac address plus an instance identifier will help keep logs seperate in the cloud. Additional details can be added to locationIdentifier, but it is best to keep this somewhat short.
Additionally, logging some unique details to the site on start up will help associate the locationIdentifier with an actual site. Suggestions might be to log the check headers on start up to get the phone number/location name.... This will help to identify who a locationIdentifier might belong to in the cloud.

Example Implementation.

using Shift4_ExternalISV_CloudLogging;
using System.Collections.Generic;

namespace TestExternalLogger
{
    class Program
    {
        public static void Main(string[] args)
        {
            LogSettings logSettings = new LogSettings();
            logSettings.cloudLoggingOn = true;
            logSettings.cloudWatchAccess = "access";
            logSettings.cloudWatchSecret = "secret";
            logSettings.locationIdentifier = "AA-BB-CC-DD-EE-FF-MeffertsLab"; //Something unique to the service logging like a MAC address
            logSettings.logGroup = LoggingUtils.LogGroup.microsBridge.Value;
            logSettings.region = LoggingUtils.LogRegion.useast1.Value;

            //Standard way to log
            LoggingUtils.writeLog(logSettings, "stand test", LoggingUtils.LogAppender.Program);


            //Log a list of log lines
            List<string> aListOfStringsToLog = new List<string>();
            aListOfStringsToLog.Add("TestLine1");
            aListOfStringsToLog.Add("TestLine2");
            LoggingUtils.writeLogArrayStringList(logSettings, aListOfStringsToLog, LoggingUtils.LogAppender.Program);

            //Log an object that can be serialized.  //will not log object if errored out for reasons like circular references.

            LoggingUtils.writeLogJsonObject(logSettings, logSettings, LoggingUtils.LogAppender.Program);
        }
    }
}

Example Output

2021-07-13 15:22:52,931 [1] DEBUG Shift4_ExternalISV_CloudLogging.LoggingUtils - Program:stand test 
2021-07-13 15:22:55,103 [1] DEBUG Shift4_ExternalISV_CloudLogging.LoggingUtils - Program:TestLine1
TestLine2
 
2021-07-13 15:22:56,445 [1] DEBUG Shift4_ExternalISV_CloudLogging.LoggingUtils - Program:{"cloudLoggingOn":true,"logGroup":"/bridge/isv/micros","region":"us-east-1","cloudWatchAccess":"access","cloudWatchSecret":"secret","locationIdentifier":"AA-BB-CC-DD-EE-FF-MeffertsLab"} 

V1.0.0.2 Added Support for formatting the logSettings.locationIdentifier to conform to AWS Cloudwatch standards. ":" will be replaced with"-" "*" will be replaced with "-" Long identifiers will be truncated at 100 characters.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0.2 128 7/28/2021
1.0.0.1 99 7/13/2021

Initial Package