func createFile()

in init/fluent_bit_init_process.go [343:360]


func createFile(filePath string, AutoClose bool) *os.File {
	if err := os.MkdirAll(filepath.Dir(filePath), 0700); err != nil {
		logrus.Errorln(err)
		logrus.Fatalf("[FluentBit Init Process] Cannot create the Directory: %s\n", filepath.Dir(filePath))
	}

	file, err := os.Create(filePath)
	if err != nil {
		logrus.Errorln(err)
		logrus.Fatalf("[FluentBit Init Process] Cannot create the file: %s\n", filePath)
	}

	if AutoClose {
		defer file.Close()
	}

	return file
}