With a very small java source you can use the GAE log with PHP. You can see this log on the console tab in Eclipse, or with the GAE Dashboard. It is also possible to download the logs from GAE with the appcfg.sh script.
This article shows you how you can use this log in your PHP scripts running on Google App Engine.
The usage in your PHP scripts is:
logInfo("I just want to say Hello!");First add resin.jar to the build path for your GAE project in Eclipse with properties -> Java build path -> Libraries
logWarning("Not good, xxx is not supported");
logSevere("Big big troubles");
Below the Java code, save it as src/gae/php_log.java in your GAE project in Eclipse.
package gae;To make Quercus aware of your new log fuctions, add below line to the file src/META-INF/services/com.caucho.quercus.QuercusModule (create this file if it not yet exists)
import java.util.logging.Logger;
import com.caucho.quercus.module.AbstractQuercusModule;
public class php_log extends AbstractQuercusModule {
private static final Logger log = Logger.getLogger(php_log.class.getName());
public void logInfo(String message) { log.info(message); }
public void logWarning(String message) { log.warning(message); }
public void logSevere(String message) { log.severe(message); }
}
gae.php_logTo activate the INFO severity (default it is at WARNING severity), add below line to the war/WEB-INF/logging.properties file.
gae.php_log.level=INFOSee quercus: java and php integration for more information how to write your own PHP functions with Java for Quercus PHP on GAE.
Geen opmerkingen:
Een reactie posten