An Oracle blog about NetBeans for PHP

Running NetBeans with an Option

Sometimes I ask people to run Netbeans with an option to provide more log messages and help me to find out a solution of a problem in this way. NetBeans doesn't log all messages and if I want to obtain more detail messages to look what happen, the IDE has to be run with an option that set appropriate log level for certain class or classes. NetBeans uses standard Java Logging API and for example, when I want to more detail log from code that take care about FTP support, it's enough to run NetBeans with option (-Dorg.netbeans.modules.php.project.connections.ftp.level=FINE  in this case) that set the log level for appropriate class/classes in the right value.

Basically there are two ways how to achieve this. From command line or add the option to the configuration file.

 The first one is simple for people who run Netbeans from command line. I have already wrote about a useful option --userdir, that allows also run more NetBeans with different settings. So from command line on unix based systems

./netbeans.sh -J-Dorg.netbeans.modules.php.project.connections.ftp.level=FINE

or on Windows

netbeans.exe -J-Dorg.netbeans.modules.php.project.connections.ftp.level=FINE

The -J switch says to the NetBeans launcher to pass the property to the virtual machine.

The second way how to add an option is to write it into netbeans.conf file that is located in etc folder in your NetBeans instalation place. The property just add to the netbeans_default_options. You have to add again the -J switch, if you want to pass it to the VM. Now you can run the ide as usually from GUI and it will be run with the option.

Join the discussion

Comments ( 1 )
  • John Yeary Monday, February 7, 2011

    Very nice. It is a very helpful hint that is not just relegated to PHP, but NetBeans logging in general.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.