Unless you've been telling it to change colour I'd expect an M8 to use the green LED for notifications (it only has red and green, and if it's like my M7 or my wife's 10 the red is only used for battery notifications by default).
The meaning would depend on context. Flashing red when trying to charge means that it's not charging due to an error: overheating is the commonest cause of this. Flashing when not charging usually means that your battery is very low. If it flashes when you try to boot up, is this accompanied by multiple vibrations (that would be very bad by the way)?