An io.Writer implementation for cloud APIs. Usefmt.Printf
write/log directly to cloud !
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 !")