Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9147493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:00:04+00:00 2026-06-17T11:00:04+00:00

I found the log4go package loses logs from time to time. Following is a

  • 0

I found the log4go package loses logs from time to time.

Following is a simple code snippet(I moved the log4go directory so the following import is ok.):

package main
import (
    "log4go"
    "log"
    "fmt"
)

func main() {
    fmt.Println("fmt")
    log.Println("log")
    log4go.Info("log4go")
    log4go.Info("log4go")
}

Then I executed it by go run test.go, and the output is as follows:

fmt
2013/01/10 15:24:04 log

The messages by log4go are not written to output.

Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:00:06+00:00Added an answer on June 17, 2026 at 11:00 am

    After checking the issues on log4go website, it seems that the log4go has a flushing problem.

    Becuase it uses a channel to write to files, if the main exits too fast, the log content will not be written.

    So adding a time.Sleep(time.Second) to the end of the code snippeet will cause the log content flush.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

found this little code snippet that seems to do what i want, but im
Found the following snippet on the Closure page on wikipedia //# Return a list
found the following code: XmlDocument cfgDoc = new XmlDocument(); loadConfigDoc(cfgDoc); // retrieve the appSettings
Found the following snippet online and are currently using it in my web application,
Found the following code in our code base: public static final int DEFAULT_LENGTH =
FOUND THE ANSWER MYSELF, see below... I'd like to have a very simple user
Found a piece of code today, that I find a little smelly... TMyObject.LoadFromFile(const filename:
Found this simple contact form on the internet. Everything is ok, but the alert
Found some examples of @NamedQuery annotations,e.g.: @NamedQuery(name=employeeBySsn query=select e from Employee e where e.ssn
found the following xsl/xml question need assistance in answering it.take it as a challenge.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.