Skip to content

Commit

Permalink
Azure Logging Info level.
Browse files Browse the repository at this point in the history
Also added remaining type of logging for Auth, Connection etc...

AB#9718
  • Loading branch information
eccles committed Jul 24, 2024
1 parent 7de13d4 commit 3bd51c8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions azbus/azlogging.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus"
)

// First attempt at incorporating azure logging. The EventSender option does not
// appear to work.
// EnableAzureLogging emits log messages using local logger.
// This must be called before any senders or receivers are opened.
// TODO: Generalise this for any azure downstream package.
func EnableAzureLogging(log Logger) {
log.Debugf("Enabling Azure Logging")
log.Infof("Enabling Azure Logging")
azlog.SetListener(func(event azlog.Event, s string) {
log.Debugf("[%s] %s", event, s)
log.Infof("Azure sdk:[%s] %s", event, s)
})

azlog.SetEvents(
// EventConn is used whenever we create a connection or any links (ie: receivers, senders).
// azservicebus.EventConn,
azservicebus.EventConn,
// EventAuth is used when we're doing authentication/claims negotiation.
// azservicebus.EventAuth,
azservicebus.EventAuth,
// EventReceiver represents operations that happen on Receivers.
azservicebus.EventReceiver,
// EventSender represents operations that happen on Senders.
azservicebus.EventSender,
// EventAdmin is used for operations in the azservicebus/admin.Client
// azservicebus.EventAdmin,
azservicebus.EventAdmin,
)
}

0 comments on commit 3bd51c8

Please sign in to comment.