You'll have to create another log.Logger
http://golang.org/pkg/log/#Logger.New
> here is my code.
>
> logf, err := os.OpenFile(logFileName, os.O_WRONLY|os.O_CREATE,
> 0640)
> if err != nil {
> log.Fatalln(err)
> }
log.SetOutput(logf)
mylogger := log.New(io.MultiWriter(logf,os.Stdout)
log.Println("goes to logf")
mylogger.Fatalln("goes to stdout and logf")
--
=====================
http://jessta.id.au
Is there a nice way to do the same, but have different logging parameters for each output? For example, I'd like the data logged to file to have date and timestamps, while the version written to stdout to be bare, just the messages themselves? I suspect there is no clever way to do that, short of writing a module which specifically does this itself...