Skip to content

Commit 69cb03c

Browse files
fix: Standardize folder name format in logs (#131)
Co-authored-by: Shubham Baldava <[email protected]>
1 parent 6f19f98 commit 69cb03c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

logger/logger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func StatsLogger(ctx context.Context, statsFunc func() (int64, int64, int64)) {
164164
func Init() {
165165
// Configure lumberjack for log rotation
166166
currentTimestamp := time.Now().UTC()
167-
timestamp := fmt.Sprintf("%d-%d-%d_%d-%d-%d", currentTimestamp.Year(), currentTimestamp.Month(), currentTimestamp.Day(), currentTimestamp.Hour(), currentTimestamp.Minute(), currentTimestamp.Second())
167+
timestamp := fmt.Sprintf("%d-%02d-%02d_%02d-%02d-%02d", currentTimestamp.Year(), currentTimestamp.Month(), currentTimestamp.Day(), currentTimestamp.Hour(), currentTimestamp.Minute(), currentTimestamp.Second())
168168
rotatingFile := &lumberjack.Logger{
169169
Filename: fmt.Sprintf("%s/logs/sync_%s/olake.log", viper.GetString("CONFIG_FOLDER"), timestamp), // Log file path
170170
MaxSize: 100, // Max size in MB before log rotation

0 commit comments

Comments
 (0)