Opened 8 years ago

Closed 8 years ago

#1405 closed defect (fixed)

logging should default to flush

Reported by: jreed Owned by: stephen
Priority: medium Milestone: Sprint-20111220
Component: logging Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket: none
Estimated Difficulty: 1 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

See these mixed up logs:

2011-11-21 13:40:55.5302011-11-21 13:40:55.531  INFOINFO   [
[b10-boss.bossb10-auth.datasrc] ] BIND10_COMPONENT_START component
b10-cmdctl is startingDATASRC_CACHE_ENABLE enabling the hotspot cache

2011-11-21 13:40:55.6382011-11-21 13:40:55.638  INFOINFO   [
[b10-boss.bossb10-auth.auth] ] BIND10_STARTING_PROCESS starting process
b10-cmdctlAUTH_SERVER_CREATED server created

...

 2011-11-21 13:40:55.889 [ b10-boss.bossERROR]  [BIND10_STARTING_PROCESS
starting process b10-zonemgrb10-auth.auth
] AUTH_CONFIG_LOAD_FAIL load of configuration failed: Server
configuration failed: Failed to initialize network servers: Permission
denied

Stephen and I discussed this months ago. Our default is logging to stderr.

Maybe we should enable output_options flush on by default.

Maybe not having flush is for performance, but readability as default is more important.

Subtickets

Change History (13)

comment:1 Changed 8 years ago by shane

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:2 Changed 8 years ago by shane

  • Feature Depending on Ticket set to none

comment:3 Changed 8 years ago by stephen

stderr is unbuffered so does not need flushing. However, having flushing enabled by default for other logging streams seems sensible.

comment:4 Changed 8 years ago by jelte

  • Estimated Difficulty changed from 0 to 1

comment:5 Changed 8 years ago by jreed

I am confused. I am using default stderr but my logs are often interspersed and often unreadable.

comment:6 Changed 8 years ago by jelte

  • Milestone changed from Next-Sprint-Proposed to Sprint-20111220

comment:7 Changed 8 years ago by stephen

  • Owner set to stephen
  • Status changed from new to assigned

comment:8 Changed 8 years ago by stephen

  • Owner changed from stephen to jreed

I've made the changes and the default for logging should be that log message are flushed to disk.screen after each message. However, I've not seen the problem you describe - can you check that this fix works?

comment:9 Changed 8 years ago by stephen

  • Status changed from assigned to reviewing

comment:10 Changed 8 years ago by jreed

  • Owner changed from jreed to stephen

Yes the change of default works. I tested this 07d2c46d78d35556a3e83f490eaa1aee9563e494 and it works for me. What do you mean by "disk.screen" above?

comment:11 Changed 8 years ago by stephen

  • Owner changed from stephen to jreed

disk.screen is actually a typo - I meant disk/screen.

I plan the following ChangeLog entry:

xxx.	[bug]		stephen
	By default the logging output stream is now flushed after each write.  This fixes
        the problem seen on some systems where log output from different processes was
        jumbled up together.  Flushing can be disabled by setting the appropriate
        option in the logging configuration.  
	(Trac #1405, git xxx)

comment:12 Changed 8 years ago by jreed

  • Owner changed from jreed to stephen

Yes, please merge.

comment:13 Changed 8 years ago by stephen

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.