Browse Source

Add log_file parameter

Change-Id: I6f8aead40646e54c8cca4a43a10ee0a9dcda09d2
Closes-Bug: #1819417
tags/14.4.0
ZhongShengping 2 months ago
parent
commit
778db279f1

+ 6
- 0
manifests/logging.pp View File

@@ -33,6 +33,10 @@
33 33
 #   If set to $::os_service_default, it will not log to any directory.
34 34
 #   Defaults to '/var/log/heat'
35 35
 #
36
+# [*log_file*]
37
+#   (Optional) File where logs should be stored.
38
+#   Defaults to $::os_service_default
39
+#
36 40
 # [*logging_context_format_string*]
37 41
 #   (Optional) Format string to use for log messages with context.
38 42
 #   Defaults to $::os_service_default
@@ -100,6 +104,7 @@ class heat::logging(
100 104
   $use_stderr                    = $::os_service_default,
101 105
   $log_facility                  = $::os_service_default,
102 106
   $log_dir                       = '/var/log/heat',
107
+  $log_file                      = $::os_service_default,
103 108
   $debug                         = $::os_service_default,
104 109
   $logging_context_format_string = $::os_service_default,
105 110
   $logging_default_format_string = $::os_service_default,
@@ -121,6 +126,7 @@ class heat::logging(
121 126
     log_config_append             => $log_config_append,
122 127
     log_date_format               => $log_date_format,
123 128
     log_dir                       => $log_dir,
129
+    log_file                      => $log_file,
124 130
     use_syslog                    => $use_syslog,
125 131
     use_json                      => $use_json,
126 132
     use_journal                   => $use_journal,

+ 4
- 0
releasenotes/notes/add-log_file-for-logging-951d66e9adda6235.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+features:
3
+  - |
4
+    Add the log_file option for logging.

+ 3
- 0
spec/classes/heat_logging_spec.rb View File

@@ -29,6 +29,7 @@ describe 'heat::logging' do
29 29
      :use_stderr                     => false,
30 30
      :log_facility                   => 'LOG_FOO',
31 31
      :log_dir                        => '/var/log',
32
+     :log_file                       => '/var/log/heat/heat.log',
32 33
      :debug                          => true,
33 34
     }
34 35
   end
@@ -63,6 +64,7 @@ describe 'heat::logging' do
63 64
         :use_journal => '<SERVICE DEFAULT>',
64 65
         :use_stderr  => '<SERVICE DEFAULT>',
65 66
         :log_dir     => '/var/log/heat',
67
+        :log_file    => '<SERVICE DEFAULT>',
66 68
         :debug       => '<SERVICE DEFAULT>',
67 69
       )
68 70
     end
@@ -77,6 +79,7 @@ describe 'heat::logging' do
77 79
         :use_stderr          => false,
78 80
         :syslog_log_facility => 'LOG_FOO',
79 81
         :log_dir             => '/var/log',
82
+        :log_file            => '/var/log/heat/heat.log',
80 83
         :debug               => true,
81 84
       )
82 85
     end

Loading…
Cancel
Save