Browse Source

not yet prod

main
pvincent 3 months ago
parent
commit
f7dc0efa81
  1. 8
      bin/sprod
  2. 6
      config/initializers/instrumentalizing.rb

8
bin/sprod

@ -1,9 +1,11 @@
#!/bin/bash
SEMANTIC_LOGGER_APP=bichik RAILS_ENV=production SECRET_KEY_BASE='toto est fluo' rails server
RAILS_ENV=production SECRET_KEY_BASE='toto est fluo' rails assets:precompile
# journalctl --all -o cat --full -t bichik
# journalctl --all -o short --no-hostname -t bichik
SEMANTIC_LOGGER_APP=egr RAILS_ENV=production SECRET_KEY_BASE='toto est fluo' rails server
# journalctl --all -o cat --full -t egr
journalctl --all -o short --no-hostname -t egr -f
# TO REMOVE PROD assets
# rm -rf tmp/cache/assets

6
config/initializers/instrumentalizing.rb

@ -14,6 +14,8 @@ def build_instrumentation_config
end
Rails.configuration.after_initialize do
SemanticLogger.clear_appenders!
RailsSemanticLogger::Rack::Logger.logger.level = :info # useful for remaining log like "[Rack::Log] Started..."
Rails.logger.name = 'rails'
if Rails.env.production?
@ -25,11 +27,9 @@ Rails.configuration.after_initialize do
Rails.logger.info('adding instrumentations...')
Semantic::Instrumentalizer.activate(*build_instrumentation_config)
Rails.logger.info('adding instrumentations...DONE')
Rails.logger.info('adding instrumentations...DONE', build_instrumentation_config)
else
SemanticLogger.clear_appenders!
RailsSemanticLogger::Rack::Logger.logger.level = :info # useful for remaining log like "[Rack::Log] Started..."
SemanticLogger.add_appender(
io: $stdout,

Loading…
Cancel
Save