Closed xsalefter closed 1 year ago
Since the upgrade will involve heavily testing the SSE logs integration with Kaui, we should look at https://github.com/killbill/killbill-platform/issues/61 at the same time.
To make sure testing are repeatable and could be understand clearly, we need to prepare configuration before testing executed.
<osgi-export>org.killbill.billing.osgi.bundles.logger;version=${project.version}</osgi-export>
killbill-hello-world-java-plugin
and killbill-platform-osgi-bundles-eureka
.call reset && grep -Rl "org.slf4j.LoggerFactory" to /mnt/data/vcs/git/github/apache/felix-dev
>mvn jetty:run \
-Dorg.killbill.server.properties=file:///home/xsalefter/killbill-workspace/platform-120-killbill-server.properties \
-Dlogback.configurationFile=file:///home/xsalefter/killbill-workspace/platform-120-logback.xml
killbill-platform-osgi-bundles-eureka
's README.md for Eureka installation (except that we only use 1 killbill instance).To see if logback log messages properly, testing will only use ROLLING
appender so there's no log message will be showing up in the console.
killbill-platform-osgi-bundles-logger
and killbill-platform-osgi-bundles-eureka
pluginskillbill-http-client
, call putOutOfRotation()
We should see these new lines in log output files (but nothing showing up in the console):
--------------> Setting Eureka Status to DOWN <----------------
--------------> Finished setting Eureka Status to DOWN <----------------
:heavy_check_mark:
killbill-platform-osgi-bundles-logger
, modified version of killbill-hello-world-java-plugin
<TODO link should be added>
and killbill-platform-osgi-bundles-eureka
pluginsGET http://localhost:8080/plugins/hello-world-plugin
There's 3 lines of log that comes from:
LoggerFactory
implementationLogService
implementation:heavy_check_mark:
killbill-platform-osgi-bundles-logger
(and killbill-platform-osgi-bundles-eureka
, is used) get removed.killbill-hello-world-java-plugin
There's 2 condition:
org.osgi.framework.BundleException:
Unable to resolve org.kill-bill.billing.plugin.java.hello-world-plugin [1](R 1.0):
missing requirement [org.kill-bill.billing.plugin.java.hello-world-plugin [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.killbill.billing.osgi.bundles.logger)(version>=0.41.0.SNAPSHOT))
Unresolved requirements: [[org.kill-bill.billing.plugin.java.hello-world-plugin [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.killbill.billing.osgi.bundles.logger)(version>=0.41.0.SNAPSHOT))]
2022-12-09T23:51:44,633+0000 lvl='WARN', log='FileInstall', th='main', xff='', rId='', tok='', aRId='', tRId='', Unable to start bundle
org.osgi.framework.BundleException: Activator start error in bundle org.kill-bill.billing.plugin.java.hello-world-plugin [1]
:heavy_check_mark:
killbill-platform-osgi-bundles-logger
installed.Webconsole showing up, and I checked the log appear in the shell console.
killbill-platform-osgi-bundles-logger
and kpm
installed.I think my changes not breaking anything, since I see this:
File: platform-120-logback.xml
:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>
<configuration>
<conversionRule conversionWord="maskedMsg" converterClass="org.killbill.billing.server.log.obfuscators.ObfuscatorConverter" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date{"yyyy-MM-dd'T'HH:mm:ss,SSSZ", UTC} lvl='%level', log='%logger{0}', th='%thread', xff='%X{req.xForwardedFor}', rId='%X{req.requestId}', tok='%X{kb.userToken}', aRId='%X{kb.accountRecordId}', tRId='%X{kb.tenantRecordId}', %maskedMsg%n</pattern>
</encoder>
</appender>
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>killbill-log.txt</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>killbill-log-%d{yyyy-MM-dd}.%i.txt</fileNamePattern>
<maxFileSize>200KB</maxFileSize>
<totalSizeCap>10GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>
<!-- These loggers are needed, otherwise there's bunch of log4jdbc spamming -->
<logger name="jdbc.sqlonly" level="OFF" additivity="false">
<appender-ref ref="SIFT-jdbc-sqlonly"/>
</logger>
<logger name="jdbc.sqltiming" level="OFF" additivity="false">
<appender-ref ref="SIFT-jdbc-sqltiming"/>
</logger>
<logger name="jdbc.audit" level="OFF" additivity="false">
<appender-ref ref="SIFT-jdbc-audit"/>
</logger>
<logger name="jdbc.resultset" level="OFF" additivity="false">
<appender-ref ref="SIFT-jdbc-resultset"/>
</logger>
<logger name="jdbc.resultsettable" level="OFF" additivity="false">
<appender-ref ref="SIFT-jdbc-resultsettable"/>
</logger>
<logger name="jdbc.connection" level="OFF" additivity="false">
<appender-ref ref="SIFT-jdbc-connection"/>
</logger>
<logger name="org.jooq.Constants" level="OFF"/>
<logger name="com.dmurph" level="OFF"/>
<logger name="org.eclipse" level="INFO"/>
<logger name="org.killbill.billing.server.updatechecker" level="INFO"/>
<logger name="org.killbill.billing.jaxrs.resources" level="INFO"/>
<logger name="org.killbill.notificationq" level="INFO"/>
<logger name="org.killbill.queue" level="INFO"/>
<root level="INFO">
<appender-ref ref="STDOUT" />
<!--<appender-ref ref="ROLLING" />-->
</root>
</configuration>
File named platform-120-killbill-server.properties
:
org.killbill.dao.url=jdbc:mysql://127.0.0.1:3306/killbill_dev
org.killbill.dao.user=root
org.killbill.dao.password=admin
# Database config (OSGI plugins)
org.killbill.billing.osgi.dao.url=jdbc:mysql://127.0.0.1:3306/killbill_osgi_dev
org.killbill.billing.osgi.dao.user=root
org.killbill.billing.osgi.dao.password=admin
# Eureka client specifics configuration. Read more https://github.com/Netflix/eureka/wiki/Configuring-Eureka
eureka.serviceUrl.default=http://localhost:8761/eureka
eureka.registration.enabled=true
eureka.name=killbill
eureka.port.enabled=true
eureka.securePort.enabled=false
eureka.statusPageUrlPath=/1.0/metrics
eureka.healthCheckUrlPath=/1.0/healthCheck
eureka.decoderName=JacksonJson
eureka.preferSameZone=true
eureka.shouldUseDns=false
# Enable eureka in Kill Bill
org.killbill.eureka=true
org.killbill.osgi.bundle.install.dir=/home/xsalefter/killbill-plugins
# needed if want to use KAUI user interface
org.killbill.security.shiroResourcePath=/home/xsalefter/killbill-workspace/shiro.ini
We have this. But it turn out that working on this need more work and testing than I thought, so the PR will be closed and work will be allocated after https://github.com/killbill/killbill-oss-parent/issues/552 completed.
Quote from the PR: