Skip to content

Commit

Permalink
Deadlock in LoggerMemoryAppender / qos-logback ixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreinhard committed Dec 30, 2024
1 parent 6bc35ee commit 2edf4f1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
7 changes: 4 additions & 3 deletions projectforge-application/src/main/resources/i18nKeys.json
Original file line number Diff line number Diff line change
Expand Up @@ -1506,11 +1506,12 @@
{"i18nKey":"locale.de","bundleName":"I18nResources","translation":"German","translationDE":"Deutsch","usedInClasses":[],"usedInFiles":[]},
{"i18nKey":"locale.en","bundleName":"I18nResources","translation":"English","translationDE":"Englisch","usedInClasses":[],"usedInFiles":[]},
{"i18nKey":"locale.zh","bundleName":"I18nResources","translation":"Chinese","translationDE":"Chinesisch","usedInClasses":[],"usedInFiles":[]},
{"i18nKey":"log.level","bundleName":"I18nResources","translation":"Level","translationDE":"Level","usedInClasses":["org.projectforge.rest.scripting.AbstractScriptExecutePageRest"],"usedInFiles":[]},
{"i18nKey":"log.level.debug","bundleName":"I18nResources","translation":"Debug","translationDE":"Debug","usedInClasses":["org.projectforge.common.logging.LogLevel"],"usedInFiles":[]},
{"i18nKey":"log.level.error","bundleName":"I18nResources","translation":"Error","translationDE":"Error","usedInClasses":["org.projectforge.common.logging.LogLevel"],"usedInFiles":[]},
{"i18nKey":"log.level.error","bundleName":"I18nResources","translation":"Error","translationDE":"Fehler","usedInClasses":["org.projectforge.common.logging.LogLevel"],"usedInFiles":[]},
{"i18nKey":"log.level.info","bundleName":"I18nResources","translation":"Info","translationDE":"Info","usedInClasses":["org.projectforge.common.logging.LogLevel"],"usedInFiles":[]},
{"i18nKey":"log.level.trace","bundleName":"I18nResources","translation":"Trace","translationDE":"Trace","usedInClasses":["org.projectforge.common.logging.LogLevel"],"usedInFiles":[]},
{"i18nKey":"log.level.warn","bundleName":"I18nResources","translation":"Warn","translationDE":"Warn","usedInClasses":["org.projectforge.common.logging.LogLevel"],"usedInFiles":[]},
{"i18nKey":"log.level.trace","bundleName":"I18nResources","translation":"Trace","translationDE":"Verfolgen","usedInClasses":["org.projectforge.common.logging.LogLevel"],"usedInFiles":[]},
{"i18nKey":"log.level.warn","bundleName":"I18nResources","translation":"Warn","translationDE":"Warnung","usedInClasses":["org.projectforge.common.logging.LogLevel"],"usedInFiles":[]},
{"i18nKey":"loggedInUserInfo","bundleName":"I18nResources","translation":"Current user:","translationDE":"Angemeldet als:","usedInClasses":[],"usedInFiles":[]},
{"i18nKey":"login","bundleName":"I18nResources","translation":"Login","translationDE":"Anmelden","usedInClasses":["org.projectforge.plugins.datatransfer.restPublic.DataTransferPublicPageRest","org.projectforge.rest.pub.LoginPageRest"],"usedInFiles":[]},
{"i18nKey":"login.adminLoginRequired","bundleName":"I18nResources","translation":"Maintenance mode: Please use ProjectForge only as administrator!","translationDE":"Wartungsmodus: Bitte als Administrator:in anmelden!","usedInClasses":["org.projectforge.business.login.LoginResultStatus"],"usedInFiles":[]},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,7 @@ license.upload.title=License file
locale.de=German
locale.en=English
locale.zh=Chinese
log.level=Level
log.level.debug=Debug
log.level.error=Error
log.level.info=Info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
# contact.title.heading=Address management
# dvelop.title=D-velop
# finance.datev.upload.hint=*.xls; max. {0}
# log.level.debug=Debug
# log.level.error=Error
# log.level.info=Info
# log.level.trace=Trace
# log.level.warn=Warn
# menu.dvelop=D-velop
# menu.groovyConsole=Groovy Console
# menu.luceneConsole=Lucene Console
Expand Down Expand Up @@ -1644,11 +1639,12 @@ license.upload.title=Lizenzdatei
locale.de=Deutsch
locale.en=Englisch
locale.zh=Chinesisch
### not translated: log.level.debug=Debug
### not translated: log.level.error=Error
### not translated: log.level.info=Info
### not translated: log.level.trace=Trace
### not translated: log.level.warn=Warn
log.level=Level
log.level.debug=Debug
log.level.error=Fehler
log.level.info=Info
log.level.trace=Verfolgen
log.level.warn=Warnung
login.adminLoginRequired=Wartungsmodus: Bitte als Administrator:in anmelden!
login.error.loginExpired=Die Anmeldung war nicht erfolgreich. Bitte Administrator:in kontaktieren, da der Zugang abgelaufen ist.
login.error.loginFailed=Die Anmeldung war nicht erfolgreich. Bitte Eingabe nochmals prüfen (Groß-/Kleinschreibung bitte beachten).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class LoggerMemoryAppender : AppenderBase<ILoggingEvent?>() {
}

internal fun register(subscription: LogSubscription): LogSubscription {
log.info { "Registering subscription '${subscription.title}' for user '${subscription.user}'." }
synchronized(logSubscriptions) {
log.info { "Registering subscription '${subscription.title}' for user '${subscription.user}'." }
logSubscriptions.add(subscription)
return subscription
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ abstract class AbstractScriptExecutePageRest : AbstractDynamicPageRest() {
class LogEntry(timestamp: Date, val level: LogLevel, val message: String) {
val id = timestamp.time
val timestamp: String = PFDateTime.from(timestamp).format(DateFormatType.DATE_TIME_SECONDS)
val levelAsString = translate(level.i18nKey)
}

protected lateinit var scriptDao: AbstractScriptDao
Expand Down Expand Up @@ -171,7 +172,7 @@ abstract class AbstractScriptExecutePageRest : AbstractDynamicPageRest() {
refreshMethod = method,
).also {
it.add(UITableColumn("timestamp", title = "time", sortable = false))
it.add(UITableColumn("level", sortable = false))
it.add(UITableColumn("levelAsString", title = "log.level", sortable = false))
it.add(UITableColumn("message", title = "message.title", sortable = false))
}
)
Expand Down Expand Up @@ -272,7 +273,7 @@ abstract class AbstractScriptExecutePageRest : AbstractDynamicPageRest() {
@PathVariable("scriptId") scriptIdString: String?
): SseEmitter {
val scriptId = scriptIdString?.toLongOrNull()
object: SseEmitterTool() {
object : SseEmitterTool() {
var scriptLogger: ScriptLogger? = null
get() {
if (field == null) {
Expand Down

0 comments on commit 2edf4f1

Please sign in to comment.