Créer un fichier log avec la date et l’heure de l’opération

Author:


{filelink=6015}


import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Calendar;

public class PrintWriterCal {
  static void operations(String msg, PrintWriter pw) {
    Calendar cal = Calendar.getInstance();
    pw.printf("%s %tc", msg, cal);
  }

  public static void main(String args[]) throws Exception {

    PrintWriter pw = new PrintWriter(new FileWriter("Log.txt", true));
    operations("Information sur la cr�ation de fichier log", pw);
    pw.close();
    if (pw.checkError())
      System.out.println("Erreur E/S.");
  }
}

A Voir sur le même Sujet:

  • creer log avec date et heure
  • date heure en nom de sortie de fichier c#
  • ajouter heure fichier log
  • date et heure dans la log java
  • creer un maskformatter en java
  • trier un fichier log par date java
  • maskformatter heure
  • maskformatter java example
  • php logs heure debut ouverture fichier heure fin
  • créer fichier journal c#

Leave a Reply

Your email address will not be published. Required fields are marked *