Closed iki-v closed 8 years ago
Implement a SLF4J solution. Scala logging project.
Implement and provide wiki "how to use".
FYI. It seems that logback http://logback.qos.ch/ is now the successor of SLF4J, having a common API with SLF4J.
On Wed, Jun 10, 2015 at 3:04 PM, ikizema notifications@github.com wrote:
Implement a SLF4J solution.
— Reply to this email directly or view it on GitHub https://github.com/GELOG/adam-ibs/issues/39#issuecomment-110880211.
@karim73, I did most of the persistance job for the moment. I still need to document how it works in order to explain it to the team, but that said, I think you can start working on another task. This could be useful to other member of the team.
You can take care of it? If yes, please assigne the task to yourself and move this task to "in progress".
Thanks,
Ok, je vais consulter la librairie suggérée plus haut. @ikizema, dans ce cas je vais laisser tomber apache.parquet et je vais m'occuper de la tâche #39
Ok @karim73, c'est très bien.
Pour repondre à @karim73 "j'aurais besoin d'aide pour gerer les dependanses avec maven pour inclure au projet cette librairie" :
Très bien @karim73. Avant de passer à l'implementation, peux tu apporter plus de precisions :
Une fois defini, en mettant ici la librerie exacte (avec version) que tu souhaite utiliser, je l'importerai dans projet si tu veux. Merci,
@ikizema , L'outil que "j'ai choisi", est la librairie est : scala-logging, car il s'agit d'une librairie de logging en scala basée sur SL4J. Une fois les dependenses reglés, son utilisation est dès plus simples : Exemple : val logger = Logger(LoggerFactory.getLogger("name")) logger.debug("This is very convenient ;-)")
Il s'agit d'un wrapper de SLF4J
Si vous connaissez d'autre librairie, je suis dispo pour les etudier
Ok @karim73, ce projet me plaisait bien aussi.
Il est sur Maven Central, pour l'integrer au projet il faut l'inclure dans pom.xml : Group id / organization: com.typesafe.scala-logging Artifact id / name: scala-logging Latest version is 3.1.0
Tiens nous au courant,
Merci pour l'astuce.
@ikizema , voici ce que ça donne. on verra ça plus tard si tu veux.
Dans pom.xml j'ai ajouté ce block :
<dependency>
<groupId>com.typesafe.scalalogging</groupId>
<artifactId>scala-logging</artifactId>
<version>3.1.0</version>
</dependency>
kimou@127-[16:50:48] > mvn install:install-file -Dfile=/home/karim/Documents/docs/MGL804/master/adam-ibs/ -DpomFile=/home/karim/Documents/docs/MGL804/master/adam-ibs/pom.xml ...... [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3:install-file (default-cli) on project adam-ibs: Error installing artifact 'com.ets.mgl804:adam-ibs:jar': Failed to install artifact com.ets.mgl804:adam-ibs:jar:0.1.0: /home/karim/Documents/docs/MGL804/master/adam-ibs (est un dossier) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Utilisation de logback pour le logging. Packages a inclure : logback-core et logback-classis. Il existe un troiseme package : logback-access qui s'integre avec les servlets (je l'ai pas retenu pour le projet) le package slf4j est inclus dans logback-core.
Configuration speciale a faire :
Dans pom.xml : exclure le package slf4j dans la declaration du package spark ( dù à un conflit de StaticLoggerBinder (slf4j de spark vs logback ) Ajout d'un fichier de config : src/main/resources/logback.xml
Utilisation : dans chaque class où on souhaite loguer :
On the same way as plink does, we need to log the program execution.
I have created a WriteLog scala class which I call any time I would like to write a log. For now, it does only "println". A logging to file functionality needs to be implemented.