Skip to content

writeameer/cloudlogger-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

An io.Writer implementation for cloud APIs. Usefmt.Printf write/log directly to cloud !

Logging to Azure Blob Storage

Create the io.Writer:

// Define Azure args
args := &azure.BlobStorageWriterArgs{
    AccountName:   os.Getenv("AZURE_STORAGE_ACCOUNTNAME"),
    ContainerName: os.Getenv("AZURE_STORAGE_CONTAINERNAME"),
    AccountKey:    os.Getenv("AZURE_ACCOUNT_KEY"),
    FileName:      "test.log",
}

// Create Azure writer
w := azure.NewBlobStorageWriter(args)

Start writing to it !

// Creates a file called `test.log` in the Azure storage account define earlier
fmt.Fprintf(w, "This is a test from cloudlogger !")

About

io.Writer implentation for some cloud apis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages