SlideShare une entreprise Scribd logo
Frédéric Sagez – Meetup AFUP
janvier 2017
SOMMAIRE
• Page 3…………………………………Introduction
• Page 4…………………………………Définition
• Page 5…………………………………Les Niveaux
• Page 6…………………………………Schéma (QQQDO)
• Page 7…………………………………Les Librairies
• Page 9 – 10………………...…......Exemple d’utilisation
• Page 11……………………………….Les Outils
• Page 12……………………………….Question(s)?
• Page 13……………………………….Links
INTRODUCTION
Page 3
DEFINITION
• Un Log est un condensé d’informations explicites, dont le contenu est
formaté et enregistré à un instant t
• Un Logger qui écrit des Logs est composé :
• Appender : c’est la destination où va être envoyé l’information (fichier,
console, email, etc.)
• Layout : le type de formatage de l’information (texte, html, JSON, etc.)
• Log Level : description du niveau de la sévérité de l’information (faible à très
important)
Page 4
LES NIVEAUX
PSR-3 (PHP Standard Recommandation)
Décrit une interface commune pour les Librairies de Logger utilisant 8 niveaux (RFC 5424)
Etat Niveaux Description
CRITIQUE
EMERGENCY Plus que critique
ALERT Demande une intervention
FATAL (CRITICAL) Sévère
ERREUR
ERROR Non bloquant
WARN Alerte
NORMAL
NOTICE Normal
INFO Information
DEBUG Mode développeur
Page 5
Environnement A
Environnement B
Environnement C
SCHEMA
FONCTIONNEL
TECHNIQUE
EXPLOITATION
Développeur
Testeur
Chef de projet
INTEGRATION
Dba
Admin
Outils de Supervision
SUPPORT
Page 6
LIBRAIRIES
Librairie PSR-3 Installation
Niveaux
de Log
Remarque(s)
Log4php Non
PEAR /
Composer
5
Fichier de configuration
Gestion hiérarchique des erreurs (Vs
Environnement)
Monolog Oui Composer 8
Utilisations multiples via des API
(Handlers, Formatters et Processors)
KLogger Oui Composer 8 Génère du format JSON
Analog Oui Composer - « Micro » Logger
Page 7
EXEMPLE d’utilisation avec LOG4PHP
• Exemple de code
Page 9
• Fichier de configuration
• Résultat
Page 10
OUTILS
Page 11
QUESTION(S)?
Page 12
LINKS
• Apache log4php
• http://logging.apache.org/log4php/
• Monolog - Logging for PHP
• https://github.com/Seldaek/monolog
• Klogger - Simple Logging for PHP
• https://github.com/katzgrau/KLogger
• Analog - PHP 5.3+ micro logging package
• https://github.com/jbroadway/analog
• PHP FIG - Logger Interface PSR-3
• http://www.php-fig.org/psr/psr-3/
Page 13

Contenu connexe

PDF
Le PHP chez Deezer
DOCX
ASFA - Méthodologie - Domain Driven Design
PPTX
Deck seo campus 2011 utiliser les logs serveurs
PDF
Cci octobre 2014
PPTX
Drupal 8 + Elasticsearch + Docker
PDF
Plateforme centralisée d’analyse des logs des frontaux http en temps réel dan...
PPTX
Séminaire Log Management
PPT
SMSSI ITIL
Le PHP chez Deezer
ASFA - Méthodologie - Domain Driven Design
Deck seo campus 2011 utiliser les logs serveurs
Cci octobre 2014
Drupal 8 + Elasticsearch + Docker
Plateforme centralisée d’analyse des logs des frontaux http en temps réel dan...
Séminaire Log Management
SMSSI ITIL

En vedette (19)

PPTX
A la recherche d'ElasticSearch
PPTX
Analyse combinée crawl + logs - Search Foresight & Botify
PPT
Chapitre2 prise en_main_kibana
PDF
PPT
Chapitre3 elk concepts_avances
PPTX
IDS,SNORT ET SÉCURITÉ RESEAU
PDF
[Sildes] plateforme centralisée d’analyse des logs des frontaux http en temps...
PDF
Rapport projet pfe
PPTX
PPTX
ElasticSearch : Architecture et Développement
PPTX
Beginner's Guide to SIEM
PPSX
Daily Life Around the World in January
KEY
Elasticsearch - Montpellier JUG
KEY
Paris RailsCamp 2009
PDF
Presentation des failles_de_securite
PPTX
Processus Audit SI
PDF
Rapport De PFE
PDF
Découverte de Elastic search
PDF
Point de vue beijaflore politique sécurité
A la recherche d'ElasticSearch
Analyse combinée crawl + logs - Search Foresight & Botify
Chapitre2 prise en_main_kibana
Chapitre3 elk concepts_avances
IDS,SNORT ET SÉCURITÉ RESEAU
[Sildes] plateforme centralisée d’analyse des logs des frontaux http en temps...
Rapport projet pfe
ElasticSearch : Architecture et Développement
Beginner's Guide to SIEM
Daily Life Around the World in January
Elasticsearch - Montpellier JUG
Paris RailsCamp 2009
Presentation des failles_de_securite
Processus Audit SI
Rapport De PFE
Découverte de Elastic search
Point de vue beijaflore politique sécurité
Publicité

Plus de Frédéric Sagez (16)

PPTX
Threat Modelling and managed risks for medical devices
PPTX
E-SYNERGIE - Présentation des outils du nouveau Plan Qualité Projet
PPTX
Atari ST : Histoire de l'OS
PPTX
HOPEX V2R1 : Database maintenance tasks
PPTX
Atari ST - History of The OS
PPTX
J&Cie - Présentation de la Task Force
PPT
J&Cie - Focus du Projet
PPTX
Présentation de l'Architecture de Développement du projet TRANS@ctions
PPTX
ASFA - Architecture cible du projet COLSA
PPT
Présentation de Planete Presse.ppt
DOCX
ASFA - Méthodologie - AGILE
PPTX
ASFA - Organisation et Méthodologie du projet COLSA
DOCX
Planète presse : recommandations du futur réseau
PPTX
Projet COLSA - Story-board v1
DOCX
Rapport de stage à l’IUFM de Versailles
PPT
Concept de l’Intégration Continue
Threat Modelling and managed risks for medical devices
E-SYNERGIE - Présentation des outils du nouveau Plan Qualité Projet
Atari ST : Histoire de l'OS
HOPEX V2R1 : Database maintenance tasks
Atari ST - History of The OS
J&Cie - Présentation de la Task Force
J&Cie - Focus du Projet
Présentation de l'Architecture de Développement du projet TRANS@ctions
ASFA - Architecture cible du projet COLSA
Présentation de Planete Presse.ppt
ASFA - Méthodologie - AGILE
ASFA - Organisation et Méthodologie du projet COLSA
Planète presse : recommandations du futur réseau
Projet COLSA - Story-board v1
Rapport de stage à l’IUFM de Versailles
Concept de l’Intégration Continue
Publicité

Dernier (7)

PDF
presentation_with_intro_compressee IEEE EPS France
PPTX
Presentation_Securite_Reseaux_Bac+2.pptx
PDF
FORMATION EN Programmation En Langage C.pdf
PPTX
Souveraineté numérique - Définition et enjeux pour les entreprises et les dév...
PDF
Tendances tech 2025 - SFEIR & WENVISION.pdf
PDF
Modems expliqués- votre passerelle vers Internet.pdf
PDF
FORMATION COMPLETE EN EXCEL DONE BY MR. NYONGA BRICE.pdf
presentation_with_intro_compressee IEEE EPS France
Presentation_Securite_Reseaux_Bac+2.pptx
FORMATION EN Programmation En Langage C.pdf
Souveraineté numérique - Définition et enjeux pour les entreprises et les dév...
Tendances tech 2025 - SFEIR & WENVISION.pdf
Modems expliqués- votre passerelle vers Internet.pdf
FORMATION COMPLETE EN EXCEL DONE BY MR. NYONGA BRICE.pdf

AFUP - Mini conférences PHP - Les LOGs

  • 1. Frédéric Sagez – Meetup AFUP janvier 2017
  • 2. SOMMAIRE • Page 3…………………………………Introduction • Page 4…………………………………Définition • Page 5…………………………………Les Niveaux • Page 6…………………………………Schéma (QQQDO) • Page 7…………………………………Les Librairies • Page 9 – 10………………...…......Exemple d’utilisation • Page 11……………………………….Les Outils • Page 12……………………………….Question(s)? • Page 13……………………………….Links
  • 4. DEFINITION • Un Log est un condensé d’informations explicites, dont le contenu est formaté et enregistré à un instant t • Un Logger qui écrit des Logs est composé : • Appender : c’est la destination où va être envoyé l’information (fichier, console, email, etc.) • Layout : le type de formatage de l’information (texte, html, JSON, etc.) • Log Level : description du niveau de la sévérité de l’information (faible à très important) Page 4
  • 5. LES NIVEAUX PSR-3 (PHP Standard Recommandation) Décrit une interface commune pour les Librairies de Logger utilisant 8 niveaux (RFC 5424) Etat Niveaux Description CRITIQUE EMERGENCY Plus que critique ALERT Demande une intervention FATAL (CRITICAL) Sévère ERREUR ERROR Non bloquant WARN Alerte NORMAL NOTICE Normal INFO Information DEBUG Mode développeur Page 5
  • 6. Environnement A Environnement B Environnement C SCHEMA FONCTIONNEL TECHNIQUE EXPLOITATION Développeur Testeur Chef de projet INTEGRATION Dba Admin Outils de Supervision SUPPORT Page 6
  • 7. LIBRAIRIES Librairie PSR-3 Installation Niveaux de Log Remarque(s) Log4php Non PEAR / Composer 5 Fichier de configuration Gestion hiérarchique des erreurs (Vs Environnement) Monolog Oui Composer 8 Utilisations multiples via des API (Handlers, Formatters et Processors) KLogger Oui Composer 8 Génère du format JSON Analog Oui Composer - « Micro » Logger Page 7
  • 9. • Exemple de code Page 9
  • 10. • Fichier de configuration • Résultat Page 10
  • 13. LINKS • Apache log4php • http://logging.apache.org/log4php/ • Monolog - Logging for PHP • https://github.com/Seldaek/monolog • Klogger - Simple Logging for PHP • https://github.com/katzgrau/KLogger • Analog - PHP 5.3+ micro logging package • https://github.com/jbroadway/analog • PHP FIG - Logger Interface PSR-3 • http://www.php-fig.org/psr/psr-3/ Page 13

Notes de l'éditeur

  • #3: Application Critique Fort Traffic Multicanaux
  • #4: Sensibilisation de l’utilisation de Logs
  • #7: Opérationnels + utilisateurs finaux
  • #10: Accès à un SGBD via une Classe
  • #11: Type de l’Appender Layout utilisé Level des erreurs utilisé
  • #12: Exploitation des Logs via des outils comme SPLUNK et KIBANA ou monitorer avec App Dynamics