A nit with this circuit... When it's switched on, the mains could be anywhere in its 50Hz cycle. Worse case, it will be 340V. At this instant, the capacitor will look like a short as it starts to charge, and the current is limited by the resistor (and LED) only. 340V/1k = 1/3A, which will blow or seriously damage the LED. Actually, there's an even worse case - if the circuit was switched off with -340V across the capacitor, you can now get 680V at switch-on, which is 2/3A through the LED, which will blow it.
There are a couple of ways to fix this.
- Choose a resistor value to limit the peak LED current to be within the non-repetitive peak current rating, and then choose the capacitor rating to add necessary impedance to limit the current to the desired operating current.
- Generate something like 5V using a zener, which will absorb the initial capacitor charge current. Actually, you can arrange that the zener diode absorbs nothing other than this initial charging pulse.
You can do a full bridge version too if you like, but probably not worth it for an indicator.