aws-sdk-go-v2 custom logger


With v1 of the SDK i could use logrus for my custom logger, like:

    Logger: aws.LoggerFunc(func(args ...interface{}) {
        log.WithField("process", "s3").Debug(args...)

This has changed with sdk v2,

It seems i need to use logging.logger as per

I’m having a hard time using logrus for this purpose, can anyone suggest what i need to do here?


It seems that sdk v2 offers a func wrapper to satisfy logging.logger:

import (
   log ""

func main() {
    logger := logging.LoggerFunc(func(classification logging.Classification, format string, v ...interface{}) {
        // your custom logging 
        log.WithField("process", "s3").Debug(v...)

    cfg, err := config.LoadDefaultConfig(

Answered By – reda la

Answer Checked By – Mildred Charles (GoLangFix Admin)

Leave a Reply

Your email address will not be published.