Skip to content

ngx-aws 5.0.0-pr26.0

Install from the command line:
Learn more about npm packages
$ npm install @shiftcode/ngx-aws@5.0.0-pr26.0
Install via package.json:
"@shiftcode/ngx-aws": "5.0.0-pr26.0"

About this version

@shiftcode/ngx-aws

Angular Services working with AWS

Cloudwatch Logger

Send Logs to AWS CloudWatch Logs

Use the withCloudwatchTransport(...) feature for the Logger to send log statements to CloudWatch Logs.
Optionally the CloudWatchErrorHandler can be provided to send uncaught errors to CloudWatch Logs.

Example Usage

import { ErrorHandler, NgModule } from '@angular/core'
import { provideLogger, LogLevel } from '@shiftcode/ngx-core'
import { CloudWatchErrorHandler, CloudWatchLogTransportConfig } from '@shiftcode/ngx-aws'

function cloudWatchLogConfigFactory(): CloudWatchLogTransportConfig {
  const appConfig = inject(APP_CONFIG)
  return  {
    logLevel: LogLevel.WARN,
    logGroupName: 'client-log-group-name',
    flushInterval: 3000,
    clientConfig$: of({
      region: 'eu-central-1',
      credentials: {
        accessKeyId: appConfig.iamAccessKeyId,
        secretAccessKey: appConfig.iamSecretAccessKey,
      },
    }),
  }
}

@NgModule({
  providers: [
    provideLogger(
      withCloudwatchTransport(cloudWatchLogConfigFactory), // instead of a factory the value itself could be provided
    ),
    { provide: ErrorHandler, useClass: CloudWatchErrorHandler },
  ],
})
export class AppModule {}

depends on

  • @angular/core + @angular/common
  • rxjs
  • @aws-sdk/client-cloudwatch-logs + @aws-sdk/types
  • @shiftcode/ngx-core
  • @shiftcode/utilities

Details


Assets

  • ngx-aws-5.0.0-pr26.0.tgz

Download activity

  • Total downloads 2
  • Last 30 days 0
  • Last week 0
  • Today 0