Yes... But no.
To prove this, we must prove both of these statements:
- Can I Concentrate on a spell through a Long Rest?
- Can I take a Long Rest while Concentrating on a spell?
Yes you can Concentrate through a Long Rest (as an Elf)
- Casting another spell that requires concentration. You lose concentration on a spell if you cast another spell that requires concentration. You can’t concentrate on two spells at once.
- Taking damage. Whenever you take damage while you are concentrating on a spell, you must make a Constitution saving throw to maintain your concentration. The DC equals 10 or half the damage you take, whichever number is higher. If you take damage from multiple sources, such as an arrow and a dragon’s breath, you make a separate saving throw for each source of damage.
- Being Incapacitated or killed. You lose concentration on a spell if you are Incapacitated or if you die.
If you're an Elf, you do not become Incapacitated or Unconscious while in a Trance, and therefore do not invalidate the conditions for maintaining Concentration.
If you don't have a feature like Trance, then you cannot Concentrate through a Long Rest, as you'd be unconscious.
Note that the DM might still make you roll to maintain Concentration while in a Trance if he sees fit to decide it's hard to Concentrate and Meditate at the same time:
The GM might also decide that certain environmental phenomena, such as a wave crashing over you while you’re on a storm--tossed ship, require you to succeed on a DC 10 Constitution saving throw to maintain concentration on a spell.
But.. No you can't take a Long Rest while Concentrating.
A Long Rest is ended by doing something considered light activity for more than 2 hours, or strenuous activity for more than 1 hour.
A long rest is a period of extended downtime, at least 8 hours long, during which a character sleeps or performs light activity: reading, talking, eating, or standing watch for no more than 2 hours. If the rest is interrupted by a period of strenuous activity—at least 1 hour of walking, fighting, casting Spells, or similar adventuring activity — the characters must begin the rest again to gain any benefit from it.
Casting a spell for more than 1 hour is considered a Strenuous Activity. Note that casting a spell for longer than 1 action also uses Concentration. So there's a strong case for Concentration being at least Strenuous enough to invalidate a long rest.
At the very least Concentration would fall into a similar level of focus as keeping watch or reading. But you cannot keep watch for longer than 2 hours without losing the benefits of your Long Rest. (Yes even as an elf.) Note the phrasing used here:
Standing watch is even possible during it, but for no more than 2 hours; maintaining heightened vigilance any longer than that isn’t restful.
Concentration can be seen as a form of heightened vigilance.
Comparing Concentration to a light activity like reading, remember that you cannot stop focusing on the spell for even an instant, otherwise you lose it. While reading you can set down a book for a moment, or let your thoughts wander, and the book doesn't vanish: you can keep reading after.
This strongly implies that Concentrating on a spell for more than 1 or 2 hours would invalidate your Long Rest.
Therefore, even if you can Concentrate while taking a non-unconscious Long Rest, you wouldn't be able to gain the benefits of that Long Rest if you chose to Concentrate for longer than 1 or 2 hours, depending on how strenuous Concentration is in practice. Considering you can lose it, even from being hit by a wave on a ship, I'd lean towards 1 hour myself.