A rotting log is considered an ecosystem because it functions as a microhabitat that supports a diverse community of living organisms along with non-living components. It provides food, shelter, and space for various producers, consumers, and decomposers such as fungi, bacteria, insects, and small animals. These organisms interact in food webs within the log, breaking down the wood through decomposition and recycling nutrients back into the soil, which supports plant growth in the larger forest ecosystem. Thus, a single rotting log contains a self-sustained system of organisms and their environment, fulfilling the criteria of an ecosystem.