File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -172,15 +172,14 @@ def configure(conf)
172
172
log . warn "symlink_path is unavailable on Windows platform. disabled."
173
173
@symlink_path = nil
174
174
else
175
- #add check if symlink_path has a tag placeholder.
176
- placeholder_validators ( :symlink_path , @symlink_path ) . reject { |v | v . type == :time } . each do |v |
175
+ placeholder_validators ( :symlink_path , @symlink_path ) . reject { |v | v . type == :time } . each do |v |
177
176
begin
178
177
v . validate!
178
+ rescue Fluent ::ConfigError => e
179
+ log . warn "#{ e } . This means multiple chunks are competing for a single symlink_path, so some logs may not be taken from the symlink."
179
180
end
180
- rescue Fluent ::ConfigError => e
181
- log . warn "#{ e } . This means multiple chunks are competing for a single symlink_path, so some logs may not be taken from the symlink."
182
181
end
183
-
182
+
184
183
@buffer . extend SymlinkBufferMixin
185
184
@buffer . symlink_path = @symlink_path
186
185
@buffer . output_plugin_for_symlink = self
Original file line number Diff line number Diff line change @@ -184,7 +184,8 @@ def create_driver(conf = CONFIG, opts = {})
184
184
end
185
185
end
186
186
187
- test 'symlink path has not tag placeholder or key placeholder' do
187
+ test 'warning for symlink_path not including correct placeholders corresponding to chunk keys' do
188
+ omit "Windows doesn't support symlink" if Fluent . windows?
188
189
conf = config_element ( 'match' , '**' , {
189
190
'path' => "#{ TMP_DIR } /${tag}/${key1}/${key2}/conf_test.%Y%m%d.%H%M.log" ,
190
191
'symlink_path' => "#{ TMP_DIR } /conf_test.current.log" ,
@@ -198,7 +199,7 @@ def create_driver(conf = CONFIG, opts = {})
198
199
assert_nothing_raised do
199
200
d = create_driver ( conf )
200
201
assert do
201
- d . logs . count { |log | log . include? ( "symlink_path: " ) } == 2
202
+ d . logs . count { |log | log . include? ( "multiple chunks are competing for a single symlink_path" ) } == 2
202
203
end
203
204
end
204
205
end
You can’t perform that action at this time.
0 commit comments