If you're using Firefox and Firebug, you shouldn't have to change the log configuration in Archetype.
Actually, you can use the "body logger" if you need log in any browser, but beware that this logger looks quite awful. In order to do this, replace this line in archetype.conf.js :
You can make your own kind of logger easily, and this may be explained in a futur tutorial (you can have look to the bodylogger code to do you own as it's pretty simple).
Archetype.logger = "log.firebugLogger";by this one :
Archetype.logger = "log.bodyLogger";N.B.: Other current options for the logger are : "log.nullLogger" (does nothing but no error) or "log.alertLogger" which will display an alert (and stop execution in the meantime) of what you want to log.
Be aware that alertLogger may be useful in some particular cases, but it will just quickly bug you most of the time.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>.:: Sample Application ::.</title>
<script type="text/javascript" src="archetype.js"></script>
</head>
<body>
</body>
</html>
You may want to change the title according to your application name, but beside of this, you shouldn't need anything else.
So copy and paste the above code in your html file.
If you look carefully at the interpreted html (in Firebug, the "html" tab), you can see that Archetype has loaded about more or less 8 javascript files (depending on you archetype version and your configuration).
If you look even more carefully, you'll see (provided that you haven't played too much with the configuration file) that Archetype has tried to load "${root}/src/main/webapp/Pages/Sample.js". This file is the application controller. The file where everything starts for your code.
So let's fill "Sample.js" with this content:
//Static namespace for your application
Sample = {
/**
* Sample.main is launched when Archetype is available for page Sample.html
*/
main: function()
{
//--Do your application specific configuration here, e.g.:
//Archetype.useLogger("log.firebugLogger");
// or
//Sample.conf = {foo:"bar",bar:"foo"};
//--
// you will put your application BootStrap here
Logger.log("hello, world !");
}
};
The "Sample.main()" will be called by Archetype when the environment will be available.