275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
# File 'lib/tcell_agent/rails/dlp.rb', line 275
def add(severity, message = nil, progname = nil, &block)
if TCellAgent.configuration.enabled &&
TCellAgent.configuration.should_instrument? &&
TCellAgent.configuration.should_intercept_requests? &&
severity >= self.level
progname ||= @progname
if message.nil?
if block_given?
message = yield
else
message = progname
progname = @progname
end
end
TCellAgent::Instrumentation.safe_block_no_log("Handling JSAgent add") {
dlp_policy = TCellAgent.policy(TCellAgent::PolicyTypes::DataLoss)
request_env = TCellAgent::Instrumentation::Rails::Middleware::ContextMiddleware::THREADS.fetch(Thread.current.object_id, nil)
if message && dlp_policy && request_env
tcell_context = request_env[TCellAgent::Instrumentation::TCELL_ID]
if tcell_context
tcell_context.filter_log(message)
end
end
}
end
tcell_old_add(severity, message, progname)
end
|