Is it possible to specify custom error log format on Nginx?

You can’t specify your own format, but in nginx build-in several level’s of error_log-ing. Syntax: error_log file [ debug | info | notice | warn | error | crit ] Default: ${prefix}/logs/error.log Specifies the file where server (and fastcgi) errors are logged. Default values for the error level: in the main section – error in … Read more

What does `:location => …` and `head :ok` mean in the ‘respond_to’ format statement?

render … :location => @user will set the HTTP location header to inform the client of the location of the newly created resource (that is, its URL) head :ok sets render to return an empty response (so just the header, no body) with status 200. head :ok is shorthand for render nothing: true, status: :ok. … Read more

How to get the given date string format(pattern) in java?

import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; public class NewClass { private static final String[] formats = { “yyyy-MM-dd’T’HH:mm:ss’Z'”, “yyyy-MM-dd’T’HH:mm:ssZ”, “yyyy-MM-dd’T’HH:mm:ss”, “yyyy-MM-dd’T’HH:mm:ss.SSS’Z'”, “yyyy-MM-dd’T’HH:mm:ss.SSSZ”, “yyyy-MM-dd HH:mm:ss”, “MM/dd/yyyy HH:mm:ss”, “MM/dd/yyyy’T’HH:mm:ss.SSS’Z'”, “MM/dd/yyyy’T’HH:mm:ss.SSSZ”, “MM/dd/yyyy’T’HH:mm:ss.SSS”, “MM/dd/yyyy’T’HH:mm:ssZ”, “MM/dd/yyyy’T’HH:mm:ss”, “yyyy:MM:dd HH:mm:ss”, “yyyyMMdd”, }; /* * @param args */ public static void main(String[] args) { String yyyyMMdd = “20110917”; parse(yyyyMMdd); … Read more

Common Lisp’s equivalent of \r inside the format function?

Characters for return and linefeed \r is the character #\return in Common Lisp. \n is the character #\linefeed in Common Lisp. The following ends the string “Hello world.” with return and linefeed. (format t “Hello world.~C~C” #\return #\linefeed) #\newline is whatever the platform uses as a line division. On Unix machines this is often the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)