It is found in a range of habitats including among undergrowth in both primary and secondary forests, woodland edges, clearings, palm groves, reedbeds, marshes, mangroves, rough grassland, paddifields and gardens at altitudes of up to 1800 meters .