I have a massive log file which breaks the 2Meg limit and hence truncates.
There is some information I need that I am logging by doing
However, I don’t get to see because of the logfile truncation. I change the logging settings so that everything is logged at ERROR except apex code but this still does not bring logging under 2 Meg.
There are various ways you can reduce your log file size.
The first step is to set the logging level on the important log statements to either Info, Warn or Error:
System.debug(LoggingLevel.Info, 'Important log message');
Then, reduce the logging level that gets captured. Such as setting class specific logging levels as per @Sdry’s answer.
If you are capturing the log via anonymous Apex execution you can alter the logging levels that get captured.
With Eclipse you could reduce the Apex Code category to Info and all other categories to None.
This should greatly reduce the size of your log.
You can do the same thing with running automated test cases.
Force.com Developer Console
With the Force.com Developer Console it is hidden under the Workspace (although I suspect it will be moving again with the Summer 13 release):
The log filters can also be altered from Setup > Administration Setup > Monitoring > Debug Logs. Then, under monitored users use the Filters link in the action column.
You might find it easier to just use the URL after replacing serverinstance and the user_id values:
You can also alter these levels with the FuseIT SFDC Explorer (Full Disclosure: Shameless plug for a free tool I tinker with):
Apex Test Execution: