Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
parlote-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
parlote-facil
Validations
b491ecac
Valider
b491ecac
rédigé
il y a 9 ans
par
Benjamin Neff
Validation de
Dennis Schubert
il y a 9 ans
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
wrap the sidekiq logger to add the context info again
closes #5988
parent
7c0e50c2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
4
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
Changelog.md
+1
-0
1 ajout, 0 suppression
Changelog.md
app/workers/base.rb
+6
-4
6 ajouts, 4 suppressions
app/workers/base.rb
config/initializers/sidekiq.rb
+19
-1
19 ajouts, 1 suppression
config/initializers/sidekiq.rb
config/logging.rb
+3
-2
3 ajouts, 2 suppressions
config/logging.rb
avec
29 ajouts
et
7 suppressions
Changelog.md
+
1
−
0
Voir le fichier @
b491ecac
...
...
@@ -15,6 +15,7 @@
*
Refactored the Logger to add basic logrotating and more useful timestamps
[
#5975
](
https://github.com/diaspora/diaspora/pull/5975
)
*
Gracefully handle mailer failures if a like is already deleted again
[
#5983
](
https://github.com/diaspora/diaspora/pull/5983
)
*
Ensure posts have an author
[
#5986
](
https://github.com/diaspora/diaspora/pull/5986
)
*
Improve the logging messages of Sidekiq messages
[
#5988
](
https://github.com/diaspora/diaspora/pull/5988
)
## Bug fixes
*
Disable auto follow back on aspect deletion
[
#5846
](
https://github.com/diaspora/diaspora/pull/5846
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
app/workers/base.rb
+
6
−
4
Voir le fichier @
b491ecac
...
...
@@ -8,10 +8,6 @@ module Workers
sidekiq_options
backtrace:
(
bt
=
AppConfig
.
environment
.
sidekiq
.
backtrace
.
get
)
&&
bt
.
to_i
,
retry:
(
rt
=
AppConfig
.
environment
.
sidekiq
.
retry
.
get
)
&&
rt
.
to_i
def
logger
@logger
||=
::
Logging
::
Logger
[
self
]
end
# In the long term we need to eliminate the cause of these
def
suppress_annoying_errors
(
&
block
)
yield
...
...
@@ -40,5 +36,11 @@ module Workers
"duplicate key in table 'posts'"
)
.
any?
{
|
index
|
e
.
message
.
include?
index
}
end
private
def
logger
@logger
||=
::
Logging
::
Logger
[
self
]
end
end
end
Ce diff est replié.
Cliquez pour l'agrandir.
config/initializers/sidekiq.rb
+
19
−
1
Voir le fichier @
b491ecac
...
...
@@ -28,7 +28,25 @@ Sidekiq.configure_server do |config|
# Make sure each Sidekiq process has its own sequence of UUIDs
UUID
.
generator
.
next_sequence
Sidekiq
.
logger
=
Logging
.
logger
[
Sidekiq
]
# wrap the logger to add the sidekiq job context to the log
class
SidekiqLogger
<
SimpleDelegator
SPACE
=
" "
# only info is used with context
def
info
(
data
=
nil
)
return
false
if
Logger
::
Severity
::
INFO
<
level
data
=
yield
if
data
.
nil?
&&
block_given?
__getobj__
.
info
(
"
#{
context
}#{
data
}
"
)
end
# from sidekiq/logging.rb
def
context
c
=
Thread
.
current
[
:sidekiq_context
]
"
#{
c
.
join
(
SPACE
)
}
: "
if
c
&&
c
.
any?
end
end
Sidekiq
::
Logging
.
logger
=
SidekiqLogger
.
new
(
Logging
.
logger
[
Sidekiq
])
end
Sidekiq
.
configure_client
do
|
config
|
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
config/logging.rb
+
3
−
2
Voir le fichier @
b491ecac
...
...
@@ -6,7 +6,8 @@ Logging::Rails.configure do |config|
Logging
.
format_as
:inspect
# The default layout used by the appenders.
layout
=
Logging
.
layouts
.
pattern
(
pattern:
"[%d] %-5l %c : %m
\n
"
)
pattern
=
"[%d] %-5l PID-%p TID-%t %c: %m
\n
"
layout
=
Logging
.
layouts
.
pattern
(
pattern:
pattern
)
# Setup a color scheme called 'bright' than can be used to add color codes
# to the pattern layout. Color schemes should only be used with appenders
...
...
@@ -30,7 +31,7 @@ Logging::Rails.configure do |config|
Logging
.
appenders
.
stdout
(
"stdout"
,
auto_flushing:
true
,
layout:
Logging
.
layouts
.
pattern
(
pattern:
"[%d] %-5l %c : %m
\n
"
,
pattern:
pattern
,
color_scheme:
"bright"
)
)
if
config
.
log_to
.
include?
"stdout"
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter