コード例 #1
0
        public async Task WritingAnObjectAsync()
        {
            var config = new AWS.Logger.AWSLoggerConfig("Fusion.AWSCloudWatch");

            config.Region   = "us-east-1";
            config.LogGroup = "FcdsTrace";

            LoggerFactory logFactory = new LoggerFactory();

            logFactory.AddAWSProvider(config);
            var logger = logFactory.CreateLogger <CloudWatchLogger>();

            logger.LogInformation(logTraceBuilder.ToString());

            var configpii = new AWS.Logger.AWSLoggerConfig("Fusion.AWSCloudWatch");

            configpii.Region   = "us-east-1";
            configpii.LogGroup = "Fcdspii";

            LoggerFactory logFactorypii = new LoggerFactory();

            logFactorypii.AddAWSProvider(configpii);
            var loggerpii = logFactorypii.CreateLogger <CloudWatchLogger>();

            loggerpii.LogInformation(logPIIBuilder.ToString());
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ywr/aws-logging-dotnet
        public static void Main(string[] args)
        {
            var config = new AWS.Logger.AWSLoggerConfig("AspNetCore.ConsoleSample");

            config.Region = "us-east-1";

            LoggerFactory logFactory = new LoggerFactory();

            logFactory.AddAWSProvider(config);
            var logger = logFactory.CreateLogger <Program>();

            logger.LogInformation("Check the AWS Console CloudWatch Logs console in us-east-1");
            logger.LogInformation("to see messages in the log streams for the");
            logger.LogInformation("log group AspNetCore.ConsoleSample");
        }