mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 04:22:25 -05:00 
			
		
		
		
	[feature] attach any request errors if found, only set level=ERROR if code >= 500 (#2300)
This commit is contained in:
		
					parent
					
						
							
								c7b6cd7770
							
						
					
				
			
			
				commit
				
					
						ece2e795e0
					
				
			
		
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -87,9 +87,13 @@ func Logger(logClientIP bool) gin.HandlerFunc { | ||||||
| 			lvl := level.INFO | 			lvl := level.INFO | ||||||
| 
 | 
 | ||||||
| 			if code >= 500 { | 			if code >= 500 { | ||||||
| 				// This is a server error | 				// Actual server error. | ||||||
| 				lvl = level.ERROR | 				lvl = level.ERROR | ||||||
| 				l = l.WithField("error", c.Errors) | 			} | ||||||
|  | 
 | ||||||
|  | 			if len(c.Errors) > 0 { | ||||||
|  | 				// Always attach any found errors. | ||||||
|  | 				l = l.WithField("errors", c.Errors) | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			// Get appropriate text for this code. | 			// Get appropriate text for this code. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue