public static void WritePaymentLog(String log, String id_payment){
        StringBuilder sb = new StringBuilder();
        try{
            String path_log = "/home/terminal/Log/LogPayment/Payment_"+id_payment+".txt";
            File Log_path = new File(path_log);
            if (!Log_path.exists()){
                try {
                    Log_path.createNewFile();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            BufferedReader in = new BufferedReader(new FileReader( new File(path_log).getAbsoluteFile()));
            String read_log;
            if (sb.length()>0)
            {
                sb.delete(0,sb.length()-1);
            }
            while ((read_log = in.readLine()) != null)
            {
                if (sb.length()>0)
                {
                    sb.append(read_log);
                    sb.append("\n");
                }
            }
            in.close();
            String str="";
            str =sb + log;
            PrintStream printStream = new PrintStream(new FileOutputStream(path_log, true), true);
            printStream.println(str);
            printStream.close();
        }
        catch (Exception e){

        }
    }